== 1) }
@{$rule->{path}};
$rule->{structure} = s_decode($rule->{structure}, 'JSON')
if (exists $rule->{structure});
}
}
sub defaults {
my $self = shift;
});
if (exists $opts->{structure}) {
$opts->{source} = s_encode($opts->{structure}, 'JSON', {pretty => 0});
$source = $opts->{structure}
}
my $spath = eval { str2path($pa
ot defined or empty. Rule-wide option. May be used
several times.
=item B<--structure> E<lt>JSONE<gt>
JSON structure to merge with. Rule-wide option. May be used several times.
=item B<--[no]strict
use warnings FATAL => 'all';
use parent 'App::NDTools::NDTool';
use Digest::MD5 qw(md5_hex);
use JSON qw();
use Log::Log4Cli;
use App::NDTools::Slurp qw(s_dump);
use Struct::Path 0.80 qw(list_paths p
'bold black',
'strict' => 1, # exit with 8 if unexisted path specified
'ofmt' => 'JSON',
};
}
sub dump {
my ($self, $uri, $data) = @_;
$uri = \*STDOUT unless ($self->{OPT
e {
$self->dump($uri, \@data);
}
}
die_info "All done", 0;
}
my $JSON = JSON->new->canonical->allow_nonref;
sub list_keys {
my ($self, $data) = @_;
my @out;
AL => 'all';
use parent 'App::NDTools::NDTool';
use Algorithm::Diff qw(compact_diff);
use JSON qw();
use JSON::Patch 0.04 qw();
use App::NDTools::Slurp qw(s_dump);
use App::NDTools::Util qw(is_number
lStyle 0.80 qw(str2path path2str);
use Term::ANSIColor qw(color);
our $VERSION = '0.61';
my $JSON = JSON->new->canonical->allow_nonref;
my %COLOR;
sub arg_opts {
my $self = shift;
return (
tx-text=i' => \$self->{OPTS}->{'ctx-text'},
'grep=s@' => \$self->{OPTS}->{grep},
'json' => sub { $self->{OPTS}->{ofmt} = $_[0] },
'ignore=s@' => \$self->{OPTS}->{ignore},
er::Raw arguments, or as a
pre-created Data::Serializer::Raw object. Defaults to C<JSON>.
Consider using the C<JSON> or C<Sereal> serializers for speed.
C<Sereal> will likely be the fastest and pro
erializer::Raw' ]) | HashRef) | NonEmptySimpleStr,
init_arg => 'serializer',
default => 'JSON',
);
has serializer => (
is => 'lazy',
isa => InstanceOf[ 'Data::Serializer::
er::Raw arguments, or as a
pre-created Data::Serializer::Raw object. Defaults to C<JSON>.
Consider using the C<JSON::XS> or C<Sereal> serializers for speed.
C<Sereal> will likely be the fastest and
erializer::Raw' ]) | HashRef) | NonEmptySimpleStr,
init_arg => 'serializer',
default => 'JSON',
);
has serializer => (
is => 'lazy',
isa => InstanceOf[ 'Data::Serializer::
package Test::TCM::Role::API;
=head1 NAME
Test::TCM::Role::API - Role to test PSGI-based JSON API using
L<Test::Class::Moose>.
=head1 SYNOPSIS
package TestsFor::MyApp::Controller::API::v1::Som
[GET => '/character'],
{
status => HTTP_OK,
json_content => {
superhashof(
{
}
],
{
status => HTTP_OK,
json_content => {
success => 1,
character_id => ignore(),
se MooseX::Storage;
#use Data::Dumper;
use File::Spec::Functions;
with Storage(
'format' => 'JSON',
'io' => 'File',
traits => ['DisableCycleDetection']
);
#has 'log' => (
#is => '
er::Raw arguments, or as a
pre-created Data::Serializer::Raw object. Defaults to C<JSON>.
Consider using the C<JSON::XS> or C<Sereal> serializers for speed.
=cut
has _serializer_arg => (
is
erializer::Raw' ]) | HashRef) | NonEmptySimpleStr,
init_arg => 'serializer',
default => 'JSON',
);
has serializer => (
is => 'lazy',
isa => InstanceOf[ 'Data::Serializer::
LWP::Simple;
use JSON;
my $DBI = DBIx::Config->new(
load_credentials => sub {
my ( $self, $config ) = @_;
return decode_json(
ge
Which serializer to use? Nowadays L<Sereal> is the serialization
performance heavyweight, with L<JSON::XS> coming up a close second.
=item *
Which driver to use? Some backends have more than one d
:Tiny;
use JSON::MaybeXS;
use Kubernetes::REST::Error;
use Kubernetes::REST::HTTPRequest;
use Module::Runtime qw/require_module/;
has _json => (is => 'ro', default => sub { JSON::MaybeXS->n
(defined $body_struct) ? ('Content-Type' => 'application/json') : (),
Accept => 'application/json',
});
$req->content($self->_json->encode($body_struct)) if (defined $body_struct);
uired_props});
}
}
package CloudDeploy::AMIDB {
use Moose;
use Carp;
use DateTime;
use JSON;
use CloudDeploy::Config;
use Data::Dumper;
use Carp;
has account => (is => 'ro', isa =>
ontinueAfter => $continueAfter,
};
}
# takes an ACE (singular version of ACL) and produces a JSON-serializable
# dictionary for transmitting over the wire
sub SerializeACE {
my $self = shift;
}
}
return $record;
}
# takes a user, group, ticket, queue, etc and produces a JSON-serializable
# dictionary
sub SerializeRecord {
my $self = shift;
my $record = shift;
self->URLForRecord($record),
disabled => $self->DisabledForRecord($record) ? JSON::true : JSON::false,
primary_record => $self->SerializeRecord($primary_record),
};
re
',
];
package CCfnX::PersistentDeployment {
use Moose::Role;
use Carp;
use DateTime;
use JSON;
use CloudDeploy::Config;
requires 'params';
has mongo => (is => 'rw', default => sub { Cl
age Kubernetes::REST::Result2Hash;
use Moo;
use JSON::MaybeXS;
use Kubernetes::REST::Error;
has parser => (is => 'ro', default => sub { JSON::MaybeXS->new });
sub result2return {
my ($
bernetes::REST::Error->throw(
type => 'UnparseableResponse',
message => 'Can\'t parse JSON content',
detail => $response->content,
) if ($@);
# Throw a Kubernetes::REST::Rem
=> 'Cell Lab Design File',
'geo' => 'TruTops Geometry File',
'geojson' => 'GeoJSON File',
'gexf' => 'Graph Exchange XML Format File',
'gf' => 'ME
ipt',
'jsl' => 'Corel PaintShop Pro Shape Library',
'json' => 'JavaScript Object Notation File',
'jsonlz4' => 'Compressed Firefox Bookmarks Backup File',
'jsp'
=> 'Java Server Page',
'jspa' => 'Java Servlet Alias',
'jspf' => 'JSON Playlist File',
'jspx' => 'XML Java Server Page',
'jss' => 'JavaScript St
tcuts;
use Carp;
use Moose::Exporter;
use Regexp::Common qw(net);
use LWP::Simple;
use JSON::MaybeXS;
use Scalar::Util qw(looks_like_number);
use CCfnX::DSL::Inheritance;
our $ubuntu
orm' ],
as_is => [ qw/Ref ConditionRef GetAtt UserData CfString Parameter Attribute FindImage Json
Tag GetPolicy ELBListener TCPELBListener SGRule SGEgressRule
GetA
gs });
},
);
}
sub metadata {
Moose->throw_error('Usage: metadata \'name\' => {json-object}')
if (@_ != 3);
my ( $meta, $name, @options ) = @_;
if (my ($att) = ($na
or " . $call->method if (not defined $return_class);
my $object = eval {
$self->parser->json_to_object($return_class, $response->content);
};
Kubernetes::REST::Error->throw(
ty
bernetes::REST::Error->throw(
type => 'UnparseableResponse',
message => 'Can\'t parse JSON content',
detail => $response->content,
) if ($@);
# Throw a Kubernetes::REST::Rem
gle::Places - Interface to Google Places API.
=head1 VERSION
Version 0.37
=cut
use 5.006;
use JSON;
use Data::Dumper;
use WWW::Google::UserAgent;
use WWW::Google::UserAgent::DataTypes qw(:all);
u
default => sub { 'false' });
has 'output' => (is => 'ro', isa => FileType, default => sub { 'json' });
has 'language' => (is => 'ro', isa => Language, default => sub { 'en' });
has 'validat
tor->query_param('search', $values);
my $response = $self->get($url);
my $contents = from_json($response->{content});
my @results = map { WWW::Google::Places::SearchResult->new($_) } @{$
o Google Knowledge Graph Search API.
=head1 VERSION
Version 0.07
=cut
use 5.006;
use URI;
use JSON;
use Data::Dumper;
use WWW::Google::UserAgent;
use WWW::Google::UserAgent::DataTypes qw(:all);
u
}
$url->query_form($params);
my $response = $self->get($url);
my $contents = from_json($response->{content});
my $results = [];
foreach my $result (@{$contents->{itemListEleme