Arn => $self->target->Arn,
Id => $self->target->Id,
Input => $input->json,
},
],
});
}
__PACKAGE__->meta->make_immutable;
1;
use CloudCron::Compiler;
use CloudCron::TargetQueue;
use CloudCron::AWS::CloudWatch;
use JSON;
command_short_description q(Deploy a crontab file into AWS);
command_long_description q(Par
cf = Mojo::CallFire->new(username => '...', password => '...');
say $cf->get('/calls')->result->json('/items/0/id');
=head1 DESCRIPTION
A simple interface to the CallFire API.
Currently only L<
ema
type_int type_str type_number type_hash type_array type_maybe type_bool type_null
/;
use JSON;
use B;
use Data::Dumper;
use Scalar::Util qw/blessed/;
sub match_schema {
local @_ERRORS;
rent qw/ThaiSchema::Base/;
sub is_bool { 1 }
use JSON;
sub match {
my ($self, $value) = @_;
return 0 unless defined $value;
return 1 if JSON::is_bool($value);
return 1 if ref($value) e
tion allows only JSON::true, JSON::false, C<\1>, and C<\0>.
=back
=head1 OPTIONS
=over 4
=item $STRICT
You can check a type more strictly.
This option is useful for checking JSON types.
=item $
se Digest::SHA qw< sha1_hex sha256_hex >;
use Digest::MD5 qw< md5_hex >;
use Term::ANSIColor;
use JSON::PP;
use File::Path;
use File::Find;
use File::Copy;
use warnings;
use strict;
=head1 NAME
Ap
;
sub read_json {
open(my $fh,"<", "$base_path/packages.json") || die "cant open: $base_path/packages.json: $!";
my $json = <$fh>;
my $p = decode_json $json;
}
sub write_json {
my @p
et_packages(shift)};
my $json = encode_json \@p;
open(my $fh,">", "$base_path/packages.json") || die "cant open: $base_path/packages.json: $!";
print $fh $json;
}
sub printer {
my @p
bers = $class->SUPER::get_class_members();
return (@super_members, @class_members);
}
sub TO_JSON {
my $self = shift;
my $this = { };
my @ancestors = $self->get_class_ancestors();
=item data_format
This is either 'json' or 'perl'. If you indicate 'json' then you'll get the
raw JSON as given by the remote API. Otherwise, the JSON::from_json function
is used to transform the r
caping single and double quotes and C<\n \r \t \0>. Utf-8 symbols are pretty valid for javascript/json.
=item * C<fix_ampersands> filter is not implemented, because it's marked as depricated and will
ue = encode_utf8($self->{'val'});
$node->appendText($value);
return $node;
}
sub TO_JSON {
my $self = shift;
my $class = ref($self);
$class =~ s/VMOMI:://;
return {_clas
ints
Returns the hashref of API endpoints, loading them on first call from the C<share/endpoints.json> file.
=head2 endpoint
Processes the given endpoint as a template, using the named parameters
p
ravis token.
=head2 mime_type
MIME type to use for requests. Hardcoded default to C<travis-ci.2+json>.
=head2 base_uri
Base URI for Travis requests.
Hardcoded to the B<private> Travis CI server,
le
Digest::MD5
Compress::Zlib
Encode
Carp
URI::Escape
URI::Escape::XS
JSON::XS
);
my $cmd = {
map{
$_.(' 'x(25-length($_))) => sub { my $x=shift; sub{ system("
$node->addChild($c_node);
}
}
}
return $node;
}
sub TO_JSON {
my $self = shift;
my $this = { };
my @ancestors = $self->get_class_ancestors();
or 'blessed' ManagedObjectReferences while letting
# other types fall through to the JSON::XS processor.
if ( $type eq 'ManagedObjectReference' ) {
if (blessed
bers = $class->SUPER::get_class_members();
return (@super_members, @class_members);
}
sub TO_JSON {
my $self = shift;
my $this = { };
my @ancestors = $self->get_class_ancestors();
rint $vm->name . "\n"; # TestVM2
=head2 JSON
Support for L<JSON::XS|https://metacpan.org/pod/JSON::XS> object serialization is available through the
TO_JSON method on the SDK classes, which may be
ration with NoSQL
databases.
$coder = JSON::XS->new->convert_blessed->pretty;
$encoded_json = $coder->encode($session);
print $encoded_json;
{
"lastActiveTime" : "2017-05-
llCount" : "0",
"_class" : "UserSession"
}
Two additional properties are added to the JSON encoded string, B<_class> and B<_ancestors>. B<_class> is the
object's class name and B<_ancesto
::Run::Cmd';
use URI;
use YAML::XS ();
use LWP::UserAgent;
use HTTP::Request;
use App::Spec;
use JSON::XS;
use API::CLI::Request;
use Moo;
has dir => ( is => 'ro' );
has openapi => ( is => 'ro' );
$self->{level}--;
return;
}
sub is_literal_number {
my $self = shift;
# Stolen from JSON::Tiny
return B::svref_2object(\$_[0])->FLAGS & (B::SVp_IOK | B::SVp_NOK)
&& 0 + $
t yet documented.
=cut
no indirect;
use Future;
use Dir::Self;
use URI;
use URI::Template;
use JSON::MaybeXS;
use Syntax::Keyword::Try;
use File::ShareDir ();
use Log::Any qw($log);
use Path::Tiny
:Async::TravisCI::Config;
use Net::Async::TravisCI::Job;
use Net::Async::TravisCI::Build;
my $json = JSON::MaybeXS->new;
=head2 configure
Applies configuration, which at the moment would involve ze
<share/endpoints.json> file.
=cut
sub endpoints {
my ($self) = @_;
$self->{endpoints} ||= do {
my $path = Path::Tiny::path(__DIR__)->parent(3)->child('share/endpoints.json');
$path
= 0;
if ($res->is_success) {
$ok = 1;
if ($ct eq 'application/json') {
my $coder = JSON::XS->new->ascii->pretty->allow_nonref;
$data = $coder->decode($conte
ue = encode_utf8($self->{'val'});
$node->appendText($value);
return $node;
}
sub TO_JSON {
my $self = shift;
my $class = ref($self);
$class =~ s/VMOMI:://;
return {_clas
e warnings;
{
use URI;
use Carp;
use Readonly;
use LWP::UserAgent;
use JSON qw( from_json );
use Storable qw( store retrieve );
use HTTP::Status qw( HTTP_BAD_REQUEST );
if !$self{key};
croak "data_format must either be Perl or JSON"
if $self{data_format} !~ m{\A (?: perl|json ) \z}xmsi;
$self{ua} = LWP::UserAgent->new();
$self{ua}->agen
\%form );
$response = $self->{ua}->get($uri);
}
my $json = $response->content() || "";
my ($message) = $json =~ m{ "message" \s* : \s* "( [^"]+ )" }xms;
$message ||= $respo