r;
use 5.014;
use strict;
use warnings;
use Data::Chronicle;
use Date::Utility;
use JSON::MaybeUTF8 qw(decode_json_utf8);
use Moose;
=head1 NAME
Data::Chronicle::Reader - Provides reading from an e
->[1] } @$pairs;
my $cached_data = $self->cache_reader->mget(@keys);
return map { decode_json_utf8($_) if $_ } @$cached_data;
}
=head2 get_for
Example:
my $data = get_for("category1",
(sort keys %{$db_data})[0];
my $db_value = $db_data->{$id_value}->{value};
return decode_json_utf8($db_value);
}
=head2 get_for_period
Example:
my $data = get_for_period("category1", "
RSION = '0.0602';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has base => (
is
if ( $res->is_success ) {
my $body = $res->body;
try {
$data = decode_json($body);
}
catch {
croak $body, "\n";
};
}
else {
org/data>
L<https://acousticbrainz.readthedocs.io/api.html>
L<Moo>
L<Mojo::UserAgent>
L<Mojo::JSON>
L<Try::Tiny>
=head1 AUTHOR
Gene Boggs <gene@cpan.org>
=head1 COPYRIGHT AND LICENSE
This sof
ltClient::Object::ValidationError;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
takes these columns and returns a list of
(arrayref) rows. This can then be processed into CSV, JSON, etc. It can also
be directly inserted into your favorite database.
=head1 FUNCTIONS
=head2 da
BmltClient::Object::MeetingCreate;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
RSION = '0.0601';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has username => (
t(
$self->base . 'users/auth',
{ 'Content-Type' => 'application/json' },
json => { username => $args->{username}, password => $args->{password} },
);
if ( $res->is_success ) {
my $body = $res->body;
try {
$data = decode_json($body);
}
catch {
croak $body, "\n";
};
}
else {
use_cleanser => {
summary => 'Whether to use data cleansing before outputting to JSON',
schema => 'bool',
},
use_utf8 => {
summary => 'Whether
assed to Perinci::CmdLine constructor',
schema => 'bool',
},
per_arg_json => {
summary => 'Will be passed to Perinci::CmdLine constructor',
schema
$args{allow_prereq}) x !!$args{allow_prereq},
(per_arg_json => $args{per_arg_json} ? 1:0) x !!(defined $args{per_arg_json}),
(per_arg_yaml => $args{per_arg_yaml} ? 1:0) x !!(de
RSION = '0.0401';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has api_key => (
if ( $res->is_success ) {
my $body = $res->body;
try {
$data = decode_json($body);
}
catch {
croak $body, "\n";
};
}
else {
s and return them as a HashRef.
=head1 SEE ALSO
L<Moo>
L<Mojo::UserAgent>
L<Mojo::JSON::MaybeXS>
L<Mojo::JSON>
L<https://getsongbpm.com/api>
=head1 AUTHOR
Gene Boggs <gene@cpan.org>
=head1 CO
RSION = '0.0206';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has api_key => (
,
default => sub { 'track' },
);
has format => (
is => 'ro',
default => sub { 'json' },
);
has base => (
is => 'rw',
default => sub { 'http://ws.audioscrobbler.com' }
ss ) {
my $body = $res->body;
if ($self->format eq 'json') {
try {
$data = decode_json($body);
}
catch {
croak $bod
e BmltClient::Object::ServiceBody;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
r;
use 5.014;
use strict;
use warnings;
use Data::Chronicle;
use Date::Utility;
use JSON::MaybeUTF8 qw(encode_json_utf8);
use Moose;
=head1 NAME
Data::Chronicle::Writer - Provides writing to an eff
me, $value) = @$entry;
my $key = $category . '::' . $name;
my $encoded = encode_json_utf8($value);
$writer->publish($key, $encoded) if $self->publish_on_set && !$suppress_pub
e BmltClient::Object::MeetingBase;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
BmltClient::Object::FormatUpdate;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
ckage BmltClient::Object::Meeting;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
ient::Object::FormatPartialUpdate;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
RSION = '0.0304';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has key => (
is
if ( $res->is_success ) {
my $body = $res->body;
try {
$data = decode_json($body);
}
catch {
croak $body, "\n";
};
}
else {
tests in F<t/01-methods.t>
L<https://developers.google.com/youtube/v3/docs/search/list>
L<Mojo::JSON>
L<Mojo::URL>
L<Mojo::UserAgent>
L<Moo>
L<Try::Tiny>
=head1 AUTHOR
Gene Boggs <gene@cpan.or
_Multimethods - multi methods
=head1 SYNOPSIS
package MyApp {
use Zydeco;
class JSON::Encoder {
multi method stringify (Undef $value) {
'null';
}
multi meth
se;
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(use_m
ngify });
}
# 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_pa
return $value->datetime();
}
else {
return $value;
}
}
# Deserialize a JSON string into an object
#
# @param string $class class name is passed as a string
# @param string $
Client::Object::FormatTranslation;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};
ltClient::Object::UserCreateAllOf;
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 Date::
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {
my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_type = $self->openapi_types->{$_key};