}
# ABSTRACT: Interface for a Google Storage Object
# https://developers.google.com/storage/docs/json_api/v1/objects#resource
use Moose;
use Net::Google::Storage::Types;
has id => (
is => 'ro',
toring the data of an object, slightly cut down from
L<https://developers.google.com/storage/docs/json_api/v1/objects#resource>.
Generally Net::Google::Storage::Object objects are acquired from a
C<g
formation about the file itself - check out the
L<docs|https://developers.google.com/storage/docs/json_api/v1/objects#resource>.
=head2 contentEncoding
The content encoding of the object's data.
=h
p->evaluate_move_attempt($attempt);
return $result;
}
sub scorable{ #new? args? scorable_from_json?
my $self = shift;
my $scorable = Games::Go::Cinderblock::Scorable->new(
state => $se
WOW_ARENA_TEAM_2 WOW_ARENA_TEAM_3 WOW_ARENA_TEAM_5
);
use URI::Escape;
use LWP::UserAgent;
use JSON::XS;
use constant WOW_REGIONS =>
{
us => { api_host => 'us.battle.net' , locales => [
= $self->{ua}->get($url);
#return undef if !$res->is_success;
my $data = eval { decode_json $res->decoded_content };
return $@ ? undef : $data;
}
__PACKAGE__->_init_package;
1;
=hea
}
# ABSTRACT: Interface for a Google Storage Bucket
# https://developers.google.com/storage/docs/json_api/v1/buckets#resource
use Moose;
use Net::Google::Storage::Types;
has id => (
is => 'ro',
storing the data of a bucket, slightly cut down from
L<https://developers.google.com/storage/docs/json_api/v1/buckets#resource>.
Generally Net::Google::Storage::Bucket objects are acquired from a
C<g
f of the owner details for the bucket - see
L<the docs|https://developers.google.com/storage/docs/json_api/v1/buckets#resource>.
=head2 location
Physical location of the servers containing this buck
self) = @_;
my $files = $self->zilla->files;
@$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and
$_->isa('Dist::Zilla::File::OnDisk')) } @$files;
return;
} # end
s plugin).
=item C<%meta>
The hash of metadata (in META 2 format) that will be stored in F<META.json>.
=item C<$perl_prereq>
The minimum version of Perl required (from the prerequisites in the met
impractical to hold in memory.
Parameters:
=over 4
=item as => tsv|csv|arrayrefs|hashrefs|jsonobjects|jsonrows|count:
How each line should be returned.
=item size => Int:
How many results to retur
iendly/path:
Whether to add headers to the output (default: false)
=item json => inflate|instantiate|perl:
How to handle json (default: perl)
=item %parameters:
The template parameters
=back
Retur
erator_with {
my $self = shift;
my %args = @_;
my @keys = qw/as size start addheaders json/;
my @values = delete(@args{@keys});
my $clone = $self->get_adjusted_template(%args);
ions are available:
=over 4
=item * as => $format
Possible values: (rr|ro|objects|string|jsonobjects|jsonrows|count)
The format to request results in.
=over 8
=item * C<rr> ResultRows (default)
L<Webservice::InterMine::ResultObject>s will be returned (it is a
synonym for C<< as => "jsonobjects", json => "inflate" >>).
=item * C<objects> Instantiated L<InterMine::Model> objects.
Fully in
selected, then the results will be unparsed tab delimited rows.
=item * json[objects|rows] - raw data structures
The two json formats allow low-level access to the data-structures returned
by the we
self) = @_;
my $files = $self->zilla->files;
@$files = grep { not($_->name =~ /^META\.(?:yml|json)$/ and
$_->isa('Dist::Zilla::File::OnDisk')) } @$files;
return;
} # end
gs;
use JSON;
use LWP::UserAgent;
# load dotCloud environment
local $/;
open( my $fh, '<', '/home/dotcloud/environment.json' );
my $json_text = <$fh>;
my $dotcloud_env = decode_json( $json_text );
n' => $name_ver[0], 'v' => $name_ver[1]});
}
$data->{'installed'} = [ @installed ];
my $json_data = to_json($data); # , { pretty => 1 });
my $ua = new LWP::UserAgent(('agent' => "$NAME/$VERSION"))
otb.rhcloud.com/application/register/', { json_data => $json_data});
if (! $response->is_success) {
die $response->status_line;
}
my $content = from_json($response->decoded_content);
print "Difi
[0-9.]+)/s}) {
$results{$class}{$name}{sprintf "%4d", $1} = 0+$2;
}
}
}
}
use JSON;
print JSON->new->pretty->canonical->encode(\%results);
END { chdir '/'; }
use Moose;
with 'Webservice::InterMine::Role::Serviced';
with 'Webservice::InterMine::Role::KnowsJSON';
use Webservice::InterMine::List;
use Webservice::InterMine::Types qw(List ListOperable File Li
=> '/lists/json',
DELETION_PATH => '/lists/json',
UNION_PATH => '/lists/union/json',
INTERSECTION_PATH => '/lists/intersect/json',
SUBTRACTION_PATH => '/lists/subtract/json',
DIFF
ERENCE_PATH => '/lists/diff/json',
LIST_TAG_PATH => '/list/tags/json',
};
=head2 get_list( $name ) -> List
Get the list with the given name, if it exists. Returns undef
if the given list is not
s.
=head1 Method: build_structure($root)
Returns a Perl data structure which can be turned into JSON.
The -data_structure option to scripts/tree.pl gives you access to this feature.
=head1 Method:
package AnyMQ::Trait::Pg;
# use 5.010;
use Any::Moose 'Role';
use AnyEvent::Pg 0.04;
use JSON;
use Try::Tiny;
has 'debug' => (
is => 'rw',
isa => 'Bool',
default => 0,
);
has 'dsn' =>
);
has 'is_connected' => (
is => 'rw',
isa => 'Bool',
);
has '_json' => ( is => 'rw', lazy_build => 1, isa => 'JSON' );
has '_pg_query_watchers' => (
is => 'ro',
isa => 'ArrayRef',
construct and connect our client object
$self->_client;
}
# JSON codec pack
sub _build__json {
my ($self) = @_;
return JSON->new->utf8;
}
sub _build_client {
my ($self) = @_;
my
c License or the Artistic License for more details.
#
# ABSTRACT: Check the prereqs from our META.json
#---------------------------------------------------------------------
use 5.008;
our $VERSION =
ncluded a META.json:
sub prune_files
{
my $self = shift;
my $files = $self->zilla->files;
unless (grep { $_->name eq 'META.json' } @$files) {
$self->log("WARNING: META.json not found, rem
ereqs.t");
@$files = grep { $_->name ne 't/00-all_prereqs.t' } @$files;
} # end unless META.json
return;
} # end prune_files
#----------------------------------------------------------------
N = '1.123130';
}
use strict;
use warnings;
use Moo;
use Sub::Quote;
use Method::Signatures;
use JSON::XS;
use LWP::UserAgent;
use HTTP::Request::Common;
use XML::Simple;
# ABSTRACT: Connect to the
'x'
);
print "$uri\n" if $self->debug;
my $res;
my $type = ref $content eq 'HASH' ? 'json' : 'xml';
if($method =~ /get/i){
if(ref $content eq 'HASH') {
$uri->query_form($conte
pplication/json',
Content_Type => 'application/json',
);
} else {
#$content = $self->_template($content) if $content;
if($type eq 'json') {
print "Encoding as JSON\n" if $se
rticle/post/",
delete_url => "$SCRIPTOGRAM_API/article/delete/",
response_parser => 'JSON',
debug => 1,
);
=head1 SYNOPSIS
use WebService::Scriptogram;
my $sg = WebService:
head2 save_json( )
Pass in the path to a file you wish to write your javascript in. Optionally
you can pass in any options that would normally get passed to C<as_json>.
=cut
sub save_json {
my
$self, $file, @options ) = @_;
$self->_save( 'as_json', $file, @options );
}
=head2 as_json( )
as_json will return a string containing json suitable for
generating text for your RSS object. Yo
the name of the JSON object (default: RSSJSON).
=cut
sub as_json {
my ( $self, $max, $object_name ) = @_;
my $items = scalar @{ $self->{ items } };
$object_name = 'RSSJSON' unless define
ed.
When -data_structure is used, the program displays a data structure suitable for encoding in JSON.
When not used (and -copy is not used), the program pretty-prints the menu. This is the default
al DEBUG => { int => 1, default => 0, env => 1 };
use List::Util qw(min);
use Storable qw();
use JSON::XS qw();
use Sereal::Decoder qw();
use Sereal::Encoder qw();
use Compress::Zlib qw(Z_DEFAULT_COM
a => Bool,
default => 0,
);
enum DataFlexSerializerOutputFormats, [ qw(
storable
json
sereal
) ];
coerce DataFlexSerializerOutputFormats,
from Str,
via { lc $_ };
has ou
_format => (
is => 'rw',
isa => DataFlexSerializerOutputFormats,
default => 'json',
coerce => 1,
);
has sereal_encoder => (
is => 'ro',
isa => Object,
ost(
$service->build_uri($service->root . '/ids'),
'Content-Type' => 'application/json',
'Content' => $service->encode($self->as_submission)
);
if ( $resp->is_error ) {
hift;
return 1 if $self->completed;
$self->_backoff;
my $data = $self->service->fetch_json('/ids/' . $self->uid . '/status');
$self->_register_poll;
my $status = $data->{status};
r this job.
=cut
sub fetch_results {
my $self = shift;
my $data = $self->service->fetch_json('/ids/' . $self->uid . '/result');
return $data->{results};
}
=head2 delete()
Delete this j