- Interface to Google Page Speed Online API.
=head1 VERSION
Version 0.29
=cut
use 5.006;
use JSON;
use Data::Dumper;
use WWW::Google::UserAgent;
use WWW::Google::UserAgent::DataTypes -all;
use W
$url = $self->_url($params, $values);
my $response = $self->get($url);
return from_json($response->{content});
}
=head2 stats()
Returns the object L<WWW::Google::PageSpeedOnline::Stat
rp;
use MooseX::App;
use CloudDeploy::Utils;
use CloudDeploy::DeploymentCollection;
use JSON;
use String::Diff;
use Term::ANSIColor qw/:constants/;
use Scalar::Util;
parameter left
file:<JSON_FILE>],
required => 1,
);
parameter right => (
is => 'rw',
isa => 'Str',
documentation => q[cfn:<REGION>:<NAME>|deploy:<NAME>|file:<JSON_FILE
=> 'ro',
isa => 'Bool',
documentation => 'Pretty print the changes in JSON',
default => 0
);
has _left_cfn => (
is => 'ro',
isa => 'Cfn',
lazy =>
eaders and Content in the same order and
returns the standard response. The c<$content> should be JSON formatted. On error
throws exception of type L<WWW::Google::UserAgent::Exception>.
=cut
sub pos
- Interface to Google API Discovery Service.
=head1 VERSION
Version 0.28
=cut
use 5.006;
use JSON;
use Data::Dumper;
use WWW::Google::UserAgent;
use WWW::Google::APIDiscovery::API;
use WWW::Goog
$api_id]" unless defined $api;
my $response = $self->get($api->url);
my $contents = from_json($response->{content});
return WWW::Google::APIDiscovery::API::MetaData->new($contents);
}
=
ed_apis {
my ($self) = @_;
my $response = $self->get($BASE_URL);
my $contents = from_json($response->{content});
$self->kind($contents->{kind});
$self->version($contents->{discov
$validator = Method::ParamValidator->new( config => dist_file('WWW-Google-Places', 'method-config.json') );
$validator->get_field('location')->check(\&_check_location);
return $validator;
}
ix - Interface to Google Distance Matrix API.
=head1 VERSION
Version 0.21
=cut
use 5.006;
use JSON;
use Data::Dumper;
use WWW::Google::UserAgent;
use WWW::Google::DistanceMatrix::Result;
use WWW:
default => sub { 'en' });
has output => (is => 'ro', isa => FileType, default => sub { 'json' });
=head1 DESCRIPTION
The Google Distance Matrix API is a service that provides travel di
my $url = $self->_url($params);
my $response = $self->get($url);
my $content = from_json($response->{content});
_check_content($content);
return _result($content);
}
#
#
# PRIV
, ), *,
+, -, ;, =, ?, @, ^, _, {, |, }, and ~, in that order, characters that
are safe to use in JSON and XML formats.
This creates a string that is (1.2666) larger than the original
data, making it
', '^', '_', '{',
'|', '}', and '~'.
and allows the encoded data to be used without issue in JSON or XML.
=cut
=head2 Ascii85
Base81 is a subset of Base85, which is similar in concept to
L<Asc
package CCfnX::ConsoleDeployer {
use Moose::Role;
after deploy => sub {
my $self = shift;
print $self->origin->as_json;
}
}
1;
one at http://mozilla.org/MPL/2.0/.
package Net::BaruwaAPI;
# use utf8;
use feature 'state';
use JSON::MaybeXS;
use HTTP::Request;
use Carp qw/croak/;
use LWP::UserAgent;
use Type::Params qw/compile/
timeout => 60,
);
},
);
has 'json' => (
is => 'ro',
isa => Object,
lazy => 1,
default => sub {
return JSON::MaybeXS->new( utf8 => 1 );
}
);
sub _call
) and $res->header('Content-Type') =~ 'application/json') {
my $json = $res->decoded_content;
$data = eval { $self->json->decode($json) };
unless ($data) {
die unle
package CCfnX::CloudFormationDeployer {
use Moose::Role;
use Paws;
use JSON;
requires 'origin';
has region => (is => 'rw', isa => 'Str', required => 1, lazy => 1, default => sub { $_[0]->origin
StackName => $self->name,
Capabilities => [ 'CAPABILITY_IAM' ],
TemplateBody => $origin->as_json,
Parameters => $parameters_for_cfn,
);
my $start_time = time();
print "Polling cfn for
rceId
};
my $res = $self->cfn->DescribeStackResource(%$params);
$out->{ $att } = from_json($res->StackResourceDetail->Metadata);
}
}
return $out;
}
sub WaitForStack {
my $self
trict;
use warnings;
our $VERSION = "0.92";
use Carp;
use Path::Tiny ();
use YAML::Tiny ();
use JSON::MaybeXS ();
use Test::Builder::Module;
use Test::More ();
my $Builder = Test::Builder::Module->
->content_is("Expected content", 'test message')
->json_is({ foo => 'bar' }, 'expect file to be JSON' );
my $t = Test::TempFile->to_json({ a => 1 });
run_some_script( config_file => $t->path
$self;
}
=item to_json ( data )
Create a new tempfile, with content set to the JSON representation of C<data>.
=cut
sub to_json {
my ($class, $data) = @_;
my $json = JSON::MaybeXS->new(utf
package CCfnX::PackerDeployer {
use Moose::Role;
use JSON;
after deploy => sub {
my $self = shift;
my @lines = @{ $self->origin->Resource('Instance')->Properties->UserData->process_wit
}
]
};
open (my $file, '>', 'packer.config');
print $file encode_json($packer_def);
close $file;
#system 'packer','build';
};
before redeploy => sub {
(undef)
=item * L<JPL::Class> (undef)
=item * L<JPL::Compile> (undef)
=item * L<JSON::PP> (2.27400)
=item * L<JSON::PP::Boolean> (undef)
=item * L<List::Util> (1.45_01)
=item * L<List::Util::PP>
SCRIPTION
This module implements the L<member name restrictions|http://jsonapi.org/format/#document-member-names>
from the {json:api} specification; it can be used by repositories
to implement strict
# ABSTRACT: DAO request class
package PONAPI::DAO::Request;
use Moose;
use JSON::MaybeXS;
use PONAPI::Document;
has repository => (
is => 'ro',
does => 'PONAPI::Repository',
r
> sub { 1 },
writer => '_set_is_valid',
);
has json => (
is => 'ro',
isa => JSON::MaybeXS::JSON(),
default => sub { JSON::MaybeXS->new->allow_nonref->utf8->canonical },
);
ndef)
=item * L<JPL::Class> (undef)
=item * L<JPL::Compile> (undef)
=item * L<JSON::PP> (2.27300_01)
=item * L<JSON::PP::Boolean> (undef)
=item * L<List::Util> (1.42_02)
=item * L<List::Util::PP
(undef)
=item * L<JPL::Class> (undef)
=item * L<JPL::Compile> (undef)
=item * L<JSON::PP> (undef)
=item * L<JSON::PP::Boolean> (undef)
=item * L<List::Util> (undef)
=item * L<List::Util::PP> (u
(undef)
=item * L<JPL::Class> (undef)
=item * L<JPL::Compile> (undef)
=item * L<JSON::PP> (undef)
=item * L<JSON::PP::Boolean> (undef)
=item * L<List::Util> (1.13)
=item * L<List::Util::PP> (un
ge Convos::Plugin::ShareDialog;
use Mojo::Base 'Convos::Plugin';
use Convos::Util 'E';
use Mojo::JSON qw(false true);
use Mojo::Util qw(sha1_sum steady_time);
sub register {
my ($self, $app, $conf
->share_dialog->load() and $app->share_dialog->save()
# for loading/saving data using $self->TO_JSON()
$self->add_backend_helpers($app);
$app->helper('share_dialog.shared' => sub { $self->{share
es => $messages, end => @$messages < $query{limit} ? true : false);
$c->respond_to(
json => \%res,
any => sub { shift->render('plugin/share_dialog/messages', %res) }
);
sub TO_JSON {
my ($self, $persist) = @_;
my %json = map { ($_, $self->$_) } qw(frozen is_private name last_active last_read topic);
$json{connection_id} = $self->connection->id;
$json{dialog_
id} = $self->id;
$json{password} = $self->password if $persist;
$json{stash} = $self->stash;
$json{unread} = $self->{unread} || 0;
return \%json;
}
1;
=encoding utf8