mCloud::Object::StorageFile;
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
gramCloud::Object::LineData;
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
alizable by \$secret->to_serializable";
}
# for JSON modules
sub TO_JSON { shift->to_string }
# for CBOR
sub TO_CBOR { shift->to_string }
# for JSON, CBOR, Sereal, ...
sub FREEZE { shift->to_string
m logger
=head1 SYNOPSIS
use String::Secret;
use String::Compare::ConstantTime;
use JSON::PP ();
my $secret = String::Secret->new('mysecret');
# safe secret for logging
MyL
ecret: ********"
# and safe secret for serialization
# MyLogger->warn("invalid secret: ".JSON::PP->new->allow_tags->encode({ secret => $secret })); # oops! but the secret is hidden: invalid s
::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
oud::Object::SaveAsResponse;
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::PolylineData;
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::FileVersions;
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
ramCloud::Object::FilesList;
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
mCloud::Object::FileVersion;
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
() but got \"$check_ref\" instead." }) ) if( !$self->_is_hash( $check_ref ) );
## This is the json decoded payload
my $payload = $check_ref->{payload} || return( $self->reply({ code => Apache2
"Malformed json error" }) );
}
## Don't wait, reply ok back to Stripe so our request does not time out
$self->response->code( Apache2::Const::HTTP_OK );
## the \1 is for JSON encoder t
o transform a perl true value into a JSON 'true' one
my $json = $self->json->utf8->encode({ code => 200, success => \1 });
$self->response->print( $json );
$self->response->rflush;
$se
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
Cloud::Object::StorageExist;
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
ramCloud::Object::ShapeData;
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
ath::Class;
use Path::Class::Dir;
use Scalar::Util ();
use Sys::Hostname ();
use Data::AnyXfer::JSON;
use DateTime ();
use constant methods => qw/
debug info
notice warning
error c
sub { {} },
);
# JSON decoder/encoder
has _coder => (
is => 'ro',
isa => 'Data::AnyXfer::JSON',
init_arg => undef,
default => sub { Data::AnyXfer::JSON->new->pretty(1)->a
}
my $json;
my $logger = $self->_fetch_logger($object);
if ( my $content = $args{content} ) {
# convert Search::Elasticsearch::Error (assumed) to
# json, we are only
:Elasticsearch;
use List::MoreUtils qw( uniq );
use Data::AnyXfer ();
use Data::AnyXfer::JSON qw( encode_json );
use Data::AnyXfer::Elastic::IndexInfo ();
use Data::AnyXfer::Elastic::Logger ();
us
"Argument 'file' does not exist at: $file" unless -f $file;
my $data = Data::AnyXfer::JSON::decode_json(
$file->slurp( iomode => '<:encoding(UTF-8)' ) );
# re-enable test flags if w
pdir->file($uuid) );
# serialise the arguments
my $argsjson = encode_json($args);
$file->spew( iomode => '>:raw', $argsjson );
# return the file location / object
return $file;
}
Geo::JSON );
Validates the provided GeoJSON shape against Elasticsearch validator. Checks
for self-intersections, duplicate points etc.
=cut
sub validate_geo_shape {
my ( $self, $geojson ) = @
shape => {
coordinates => $geojson->coordinates,
type => $geojson->type,
}
}
}
ata::AnyXfer::Elastic::Index;
use Data::AnyXfer::Elastic::ScrollHelper;
use Data::AnyXfer::JSON qw/encode_json_pretty/;
=head1 NAME
Data::AnyXfer::Elastic::Role::Project
=head1 SYNOPSIS
with '
;
use MooX::Types::MooseLike::Base qw(:all);
use Carp;
use Data::AnyXfer ();
use Data::AnyXfer::JSON ();
=head1 NAME
Data::AnyXfer::Elastic::ServerDefinition - Stores node and cluster information
fer::Elastic::ServerDefinition
->load_json_file('servers.json');
# or from an open handle
open(my $open_fh, '<:encoding(UTF-8)', 'servers.json')
|| croak "Failed to open server de
ns file ($!)";
my @definitions =
Data::AnyXfer::Elastic::ServerDefinition
->load_json_handle($open_fh);
# Or define them programatically...
my $definition = Data::AnyXfer::El
ase qw(:all);
use Carp;
use Scalar::Util ( );
use Data::AnyXfer::Elastic::Import::File::Format::JSON ( );
use Data::AnyXfer::Elastic::Import::Storage::TempDirectory ( );
with 'Data::AnyXfer::Elasti
pes.
If not supplied, defaults to an instance of
L<Data::AnyXfer::Elastic::Import::File::Format::JSON>,
=back
=head1 DATA INTERFACE
B<Please see L<Data::AnyXfer::Elastic::Import::File> for the
int
mport::File::Format'],
default => sub {
Data::AnyXfer::Elastic::Import::File::Format::JSON->new
},
);
has _content_body => (
is => 'rw',
isa => ArrayRef,
lazy => 1,
b
_ES2;
use Carp;
use Moo::Role;
use MooX::Types::MooseLike::Base qw(:all);
use Clone ();
use JSON::XS ();
=head1 NAME
Data::AnyXfer::Elastic::Role::IndexInfo_ES2 - Role representing
Elasticsea
ompletion' ) {
# turn payloads on by default
$value->{payloads} = JSON::XS::true();
# XXX : backwards support to handle deprecated
# co