package SMS::Send::NANP::Twilio;
use strict;
use warnings;
use URI;
use JSON::XS qw{decode_json};
use base qw{SMS::Send::Driver::WebService};
our $VERSION = '0.06';
=head1 NAME
SMS::Send::NANP::Twi
P::Twilio->new;
my $success = $sms->send_sms(text=> 'Hello World!', to =>'+17035550123');
my $json = $sms->{__content};
my $href = $sms->{__data};
=head1 DESCRIPTION
SMS::Send driver for
success'};
$self->{'__content'} = $response->{'content'};
my $data = decode_json($response->{'content'});
$self->{'__data'} = $data;
return $data->{'status'} eq $status
trict;
use warnings;
use 5.008001;
use Carp qw( croak );
use Path::Tiny qw( path );
use JSON::PP qw( decode_json );
use URI;
use Alien::Build::Plugin;
use Alien::Build::Plugin::Download::Negotiate;
us
$res->{content})
{
$rel = decode_json $res->{content};
}
elsif($res->{path})
{
$rel = decode_json path($res->{path})->slurp_raw;
}
e
ssion;
use Mojo::Base 'Test::Mojo';
use Mojo::Util qw(b64_decode hmac_sha1_sum);
use Mojo::JSON 'decode_json';
our $VERSION = '1.07';
sub new {
my $self = shift->SUPER::new(@_);
return $self;
}
$desc) = @_;
$desc //= qq{session has value for JSON Pointer "$p"};
my $session = $self->_extract_session;
return $self->test('ok', !!Mojo::JSON::Pointer->new($session)->contains($p), $desc);
}
esc) = @_;
$desc //= qq{session has no value for JSON Pointer "$p"};
my $session = $self->_extract_session;
return $self->test('ok', !Mojo::JSON::Pointer->new($session)->contains($p), $desc);
}
# VERSION
# $Id$
use strict;
use warnings;
use base 'Chemistry::File';
use Chemistry::Mol;
use JSON;
use List::Util qw( any );
use URL::Encode qw( url_params_multi );
my @mandatory_fields = qw( ca
ile::OPTIMADE->new( file => 'myfile.json' );
my $mol = $file->read();
=cut
# Format is not registered, as OPTIMADE does not have proper file extension.
# .json is an option, but not sure if it w
my $json = decode_json $s;
if( $json->{meta} &&
$json->{meta}{api_version} &&
$json->{meta}{api_version} =~ /^[^01]\./ ) {
warn 'OPTIMADE API version ' . $json->{meta}
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::Subscriber - Provides callback subs
when practical, and a generated filename
#pod otherwise.
#pod
#pod =cut
use Digest::MD5 ();
use JSON ();
use Path::Tiny;
use String::Truncate;
use Try::Tiny;
sub new {
my ($class, $arg) = @_;
saw a simple error message; adds C<< "handled":true >>
#pod to the JSON body of the report
#pod
#pod C<%internal_arg> contains data produced by the Exception::Reporter u
e
#pod reporter.
#pod
#pod The return value of C<send_report> is not defined.
#pod
#pod =cut
my $JSON;
sub send_report {
my ($self, $summaries, $arg, $internal_arg) = @_;
# ?!? Presumably this
:Object::ServiceBodyPartialUpdate;
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};
tent-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$he
tent-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$he
/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json
JSON
our $VERSION = '1.010'; # VERSION
use 5.010;
use strict;
use warnings;
use parent qw(Plack::Middleware);
use Plack::Util;
use Plack::Util::Accessor qw(force_json);
use HTTP::Headers;
use JSON:
:MaybeXS qw(encode_json);
use HTTP::Status qw(is_error);
use Scalar::Util 'blessed';
use Log::Any qw($log);
sub call {
my $self = shift;
my $env = shift;
my $r;
my $error;
my $e
ready is JSON, so return that
if ( $orig_headers->content_type =~ m{application/json}i ) {
return;
}
# force json, or client requested JSON, so ren
r, you can output as JSON.
Examples:
# by default, show as pretty text table, like in interactive mysql client
% mysql-query DBNAME "SELECT * FROM t1"
# show as JSON (array of hashes)
% mysql-query DBNAME "QUERY..." --json ;# or, --format json
# show as CSV
% mysql-query DBNAME "QUERY..." --format csv
# show as CSV table using Text::Table::CSV
% FORMAT_PRETTY_T
). Or, you can output as JSON.
Examples:
# by default, show as pretty text table, like in interactive mysql client
% mysql-query DBNAME "SELECT * FROM t1"
# show as JSON (array of hashes)
% my
lidator';
# ABSTRACT: validate assembly stash with Rx (from JSON in kit)
use Data::Rx 0.007;
use Data::Rx::TypeBundle::Perl 0.005;
use JSON;
use Moose::Util::TypeConstraints;
use Try::Tiny;
#pod =he
in its simplest configuration. It will look for a file called
#pod F<rx.json> in the kit and will load its contents (as JSON) and use them as a
#pod schema to validate the data passed to the it's C<
od
#pod This configuration supplies an alternate filename for the JSON file:
#pod
#pod "validator": [ "Rx", { "path": "rx-schema.json" } ],
#pod
#pod This configuration supplies the schema definitio
ltClient::Object::ServiceBodyBase;
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};
ge BmltClient::Object::UserUpdate;
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};
rs.
Hopefully this implementation will eventually cover other data types like
SQL tables, XML and JSON data, etc.
Not much is documented yet, but the test suite includes numerous examples
of LINQ's u
ta::Dumper qw( Dumper );
use IO::CaptureOutput qw( capture );
use JSON::Path ();
use JSON::MaybeXS qw( decode_json );
use MIME::Base64 qw( encode_base64 );
use Types::Standard q
ault => q{}
);
has 'result_format' => (
is => 'rw',
isa => Str,
default => 'json'
);
has 'grab_response_header' => (
is => 'rw',
isa => Int,
default => 0
);
Str,
default => 'api'
);
has 'call_type' => (
is => 'rw',
isa => Str
);
has 'auto_json_decode' => (
is => 'rw',
isa => Int,
default => 0
);
has 'last_result' => (
package BmltClient::Object::Token;
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};
ent::Object::MeetingPartialUpdate;
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::NotFoundError;
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};
get/openapi-generator-cli.jar generate \
-i [URL or file path to JSON OpenAPI API spec] \
-g perl \
-c /path/to/config/file.json \
-o /path/to/output/folder
Bang, all done. Run the C<autodoc>
Patch> (see L</"HISTORY">).
=head1 SPECIFICATION
In this document, hashes are written in JSON or pseudo-JSON (e.g. contains
ellipsis C<...> or JavaScript-style comments C<// ...> or dangling comma).