@actions = @_;
my $weak_add;
my $add = sub {
while (@actions) {
my @json = try {
$self->_encode_action( splice( @actions, 0, 2 ) );
}
};
return unless @json;
push @$buffer, @json;
my $size = $self->_buffer_size;
$size += length($_) + 1 for @json;
$self->_buffer_size(
s a queue, buffering up actions
until it reaches a maximum count of actions, or a maximum size of JSON request
body, at which point it issues a C<bulk()> request.
Once you have finished adding action
::Object::FilesUploadResult;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
@_) {
my @json = $self->_encode_action( splice( @_, 0, 2 ) );
push @$buffer, @json;
my $size = $self->_buffer_size;
$size += length($_) + 1 for @json;
$self->
s a queue, buffering up actions
until it reaches a maximum count of actions, or a maximum size of JSON request
body, at which point it issues a C<bulk()> request.
Once you have finished adding action
by setting C<max_count> to C<0>. Defaults to
C<1,000>.
=item * C<max_size>
The maximum size of JSON request body to allow before triggering a
L</flush()>. This can be disabled by setting C<max_siz
loud::Object::RvmSaveOption;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
DCloud::Object::ObjectExist;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
Cloud::Object::ErrorDetails;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
oseThreeDCloud::Object::Box;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
loud::Object::STLSaveOption;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
loud::Object::ObjSaveOption;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
eeDCloud::Object::ModelData;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
turn perl hash
sub to_hash {
return decode_json(JSON->new->convert_blessed->encode( shift ));
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
eserialize the data
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[/i) { # array
get/swagger-codegen-cli.jar generate \
-i [URL or file path to JSON swagger API spec] \
-l perl \
-c /path/to/config/file.json \
-o /path/to/output/folder
Bang, all done. Run the C<auto
ext::files( $dir ) : undef;
$self->on( json => sub {
my ($ws, $data) = @_;
my $list = _get_list( $iter, $dir, $data->{limit} );
$ws->send({ json => $list });
});
}
sub _get_list {
use HTTP::Request::Common qw(DELETE POST GET HEAD PUT);
use HTTP::Status;
use URI::Query;
use JSON;
use URI::Escape;
use Scalar::Util;
use Log::Any qw($log);
use Carp;
use Module::Runtime qw(
ept' and 'Content-Type' header
my $_header_accept = $self->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
}
# body data
$body_data = to_json($body_data->to_hash) if defined $body_data && $body_data->can('to_hash'); # model to json string
my $_body_data = %$post_params ? $post_p
data_exploration/>
#pod
#pod =cut
use ETL::Yertl;
use Net::Async::HTTP;
use URI;
use JSON::MaybeXS qw( decode_json );
use List::Util qw( first );
use IO::Async::Loop;
use Time::Piece ();
use Scalar::
r fetching metric '%s': " . $res->decoded_content . "\n", $metric;
}
my $result = decode_json( $res->decoded_content );
my @points;
for my $series ( map @{ $_->{series} }, @{ $result-
tent_type => 'text/plain' )->get;
if ( $res->is_error ) {
my $result = decode_json( $res->decoded_content );
die "Error writing metric '%s': $result->{error}\n";
ent-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
ent-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
ent-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
{ shift->render }
sub user { shift->render }
sub store_user {
my $self = shift;
$self->on( json => sub {
my ($self, $data) = @_;
my $pass1 = delete $data->{pass1};
my $pass2 = dele
>{pass2};
if ( $pass1 or $pass2 ) {
unless ( $pass1 eq $pass2 ) {
$self->send({ json => {
message => 'Not saved! Passwords do not match',
success => \0,
}
;
unless ( $rs->single({ name => $data->{name} }) or $data->{password}) {
$self->send({ json => {
message => 'Cannot create user without a password',
success => \0,
} }
e;
use 5.008001;
use strict;
use warnings;
use utf8;
use LWP::UserAgent;
use HTTP::Request;
use JSON::XS;
use URI;
use File::Basename;
use Carp qw/carp croak/;
use Net::Google::OAuth;
our $VERSIO
e: $end_byte. File size: $file_size. File: $source_file";
}
return decode_json($response->content());
}
elsif ($response_code != 308) {
croak "Wrong
ication/json',
];
my $request_content = {
'type' => $permission_type,
'role' => $role,
};
my $request = HTTP::Request->new('POST', $uri, $headers, encode_json($reque
@actions = @_;
my $weak_add;
my $add = sub {
while (@actions) {
my @json = try {
$self->_encode_action( splice( @actions, 0, 2 ) );
}
};
return unless @json;
push @$buffer, @json;
my $size = $self->_buffer_size;
$size += length($_) + 1 for @json;
$self->_buffer_size(
s a queue, buffering up actions
until it reaches a maximum count of actions, or a maximum size of JSON request
body, at which point it issues a C<bulk()> request.
Once you have finished adding action
wn fox");
=head2 Filter path parameter
Any API which returns a JSON body accepts a C<filter_path> parameter
which will filter the JSON down to only the specified paths. For instance,
if you are run
ional
);
Renders the template, filling in the passed-in parameters and returns the resulting JSON, eg:
$results = $e->render_search_template(
body => {
inline => {
package Galileo::Menu;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::JSON 'j';
use Mojo::ByteStream 'b';
sub edit {
my $self = shift;
my $name = 'main';
my $schema = $self->schema;
my
Mojo::ByteStream->new( join '', @inactive ),
);
}
sub store {
my $self = shift;
$self->on( json => sub {
my ($self, $data) = @_;
my $name = $data->{name};
my $list = $data->{list};
f->memorize->expire($name);
my $content = $self->include('nav_menu') || '';
$self->send({ json => {
message => 'Changes saved',
success => \1,
content => b($content)->trim,