del::Insights;
use GeoIP2::Types
qw( JSONObject MaxMindID MaxMindLicenseKey Str URIObject UserAgentObject );
use HTTP::Headers;
use HTTP::Request;
use JSON::MaybeXS;
use MIME::Base64 qw( encode_ba
builder => '_build_base_uri',
);
has _json => (
is => 'ro',
isa => JSONObject,
init_arg => undef,
default => quote_sub(q{ JSON::MaybeXS->new(utf8 => 1) }),
);
around B
est = HTTP::Request->new(
'GET', $uri,
HTTP::Headers->new( Accept => 'application/json' ),
);
$request->authorization_basic(
$self->account_id(),
$self->licens
::Basename qw( dirname );
use File::Slurper qw( read_binary write_binary );
use Cpanel::JSON::XS qw( decode_json );
use Math::Int128 qw( MAX_UINT128 string_to_uint128 uint128 );
use MaxMind::DB::Write
tworks_with_data;
my $value = shift;
my $nodes
= decode_json( read_binary("$Dir/../source-data/$type-Test.json") );
for my $node (@$nodes) {
for my $network ( keys %$node
=item returns
Hash-ref structure that contains schema
Default: {}
See L<JSON::Schema>, L<JSON::Validator>, L<http://json-schema.org/>
=back
=head2 middleware
The middleware method. Runs before
ctionary::hash;
# ABSTRACT: Simple dictionary implementation based off a hash
use Moo::Role;
use JSON::MaybeXS;
use namespace::autoclean;
with qw(eris::role::dictionary);
our $VERSION = '0.008'; # V
my $field = decode_json($line);
$k = lc delete $field->{name};
$v = $field;
} or do {
my $err = $@;
warn "BAD JSON: $err\n\n$line\n";
PORT_OK = qw(
ArrayRef
Bool
BoolCoercion
HTTPStatus
HashRef
IPAddress
JSONObject
LocalesArrayRef
MaxMindID
MaxMindLicenseKey
MaybeStr
NameHashRef
No
( $_[0]->isa('JSON::Boolean')
|| $_[0]->isa('JSON::PP::Boolean')
|| $_[0]->isa('JSON::XS::Boolean')
|| $_[0]->isa('Cpanel::JSON::XS::Boolean
l( $_[0], 'IPAddress' )
unless Data::Validate::IP::is_ip( $_[0] ); }
);
}
sub JSONObject () {
return quote_sub(q{ GeoIP2::Types::object_can_type( $_[0], 'decode' ) });
}
{
ain.name/path",
timeout => 180,
format => "auto", # xml, json, yaml, auto
content_type => "text/plain",
sr_attrs => {
ForceContent => 1,
}
],
json => [
{ # For serialize
utf8 => 0,
ain.name/path",
timeout => 180,
format => "auto", # xml, json, yaml, auto
content_type => "text/plain",
sr_attrs => {
5.020;
use strict;
use warnings;
our $VERSION = "1.3.1";
use Moose;
use HTTP::Tiny;
use Cpanel::JSON::XS;
use IO::Async::Timer::Periodic;
use Log::Any qw($log);
use Try::Tiny::Retry ':all';
use fea
n/json',
},
$request_body,
);
return decode_json $response->{content};
}
sub run_teamcity_build ($self, $build_type_id, $properties, $build_name, $wait = 1) {
my $json =
uild($build_type_id, $properties, $build_name);
my $build_id = $json->{id};
my $build_detail_href = $json->{webUrl};
my $f = $self->loop->new_future();
if ($wait) {
err is in utf8
use strict;
# Modules
#use Log::Log4perl;
use REST::Client;
use Data::Dumper;
use JSON;
use HubSpot::Contact;
use HubSpot::Deal;
use HubSpot::Owner;
=pod
=head1 NAME
HubSpot::Client
'demo',
hub_id => '62515',
};
# Global variables
my $api_url = 'https://api.hubapi.com';
my $json = JSON->new;
sub BUILD
{
my $self = shift;
# Create ourselves a rest client to use
$self->rest
;
#~ $count = 100 unless defined $count; # Max allowed by the API
#~ my $results = $json->decode($self->_get('/deals/v1/deal/recent/modified', { count => $count }));
#~ my $deals = $res
e WebService::LogDNA::Body;
use strict;
use warnings;
use Moo;
use Time::HiRes;
use JSON::MaybeXS qw/encode_json/;
has 'line' => (
is => 'ro',
required => 1,
isa => sub {
die "Requires a lin
int(Time::HiRes::time() * 1000) }
);
has 'meta' => ( is => 'ro' );
sub to_json {
my( $self ) = @_;
return encode_json({
line => $self->line,
level => $self->level,
env => $self->env,
ti
:dictionary::cee;
# ABSTRACT: Contains fields in the Common Event Expression syntax
use Moo;
use JSON::MaybeXS;
use namespace::autoclean;
with qw(
eris::role::dictionary::hash
);
our $VERSION =
::OAuth2::VERSION = '0.03';
}
use strict;
# ABSTRACT: OAuth2 for Google Webmaster Tools API
use JSON;
use LWP::UserAgent;
use URI;
sub new {
my $class = shift;
my $self = { @_ };
die(
;
die('error getting token: ' . $res->status_line) unless $res->is_success;
return from_json($res->decoded_content);
}
sub refresh_access_token {
my ($self, $refresh_token) = @_;
m
;
die('error getting token: ' . $res->status_line) unless $res->is_success;
return from_json($res->decoded_content);
}
sub interactive {
my $self = shift;
my $url = $self->authoriz
you could verify expected functionality
get '/test' => sub {
my $c = shift;
$c->render(json => {
'tx.remote_address' => $c->tx->remote_address,
'tx.remote_proxy_addre
}
sub _parse_json {
my ($self, $json) = @_;
$self->items_per_page($json->{itemsPerPage});
$self->total_results($json->{totalResults});
$self->contains_sampled_data($json->{containsSa
a});
$self->profile_info($json->{profileInfo});
my $json_totals = $json->{totalsForAllResults};
my %totals;
while (my ($json_name, $total) = each(%$json_totals)) {
my $column
al;
}
$self->_totals(\%totals);
my @column_headers;
for my $column_header (@{ $json->{columnHeaders} }) {
push(@column_headers, {
name => _parse_column_na
use Graph;
# Even though JSON::MaybeXS is recommended, DBIx::Class already uses JSON::Any,
# so we can depend on it existing in the world.
# Note: We cannot use JSON::DWIW because it does not pr
sh is encoded the same way
# every time. Otherwise, preserve the order provided.
use JSON::Any qw(CPANEL XS JSON PP);
use Memoize qw(memoize unmemoize);
use Scalar::Util qw(reftype);
my $MEMOIZ
sult in different outputs.
my %opts = @_;
if (%opts) {
push @keys, JSON::Any->new->canonical(1)->encode(\%opts);
}
return join ':', @keys;
};
ract role which implements a decoder.
=item L<eris::log::decoder::syslog>, L<eris::log::decoder::json>
Default implementations of decoders.
=back
=head2 CONTEXT
Contexts are pluggable and are sea
ation_basic($self->key, "");
$headers->content_type('application/json; charset=UTF-8');
my $content = '{"lines":[' . $body->to_json . ']}';
my $request = HTTP::Request->new( "POST", $url, $header
package WebService::WordsAPI;
$WebService::WordsAPI::VERSION = '0.01';
use 5.006;
use Moo;
use JSON::MaybeXS;
has key => (
is => 'ro',
required => 1,
);
has ua => (
is => 'ro'
"X-Mashape-Key" => $self->key,
"Accept" => "application/json",
};
my $response = $self->ua->get($url, { headers => $heade
s} $response->{reason}\n";
}
return $self->return_type eq 'json'
? $response->{content}
: decode_json($response->{content})
;
}
sub get_word_details
{
my
izer>, L<eris::role::decoder>, L<eris::log>,
L<eris::log::decoder::syslog>, L<eris::log::decoder::json>
=head1 AUTHOR
Brad Lhotsky <brad@divisionbyzero.net>
=head1 COPYRIGHT AND LICENSE
This softw
}
use strict;
# ABSTRACT: Simple interface to the Google Search Console Core Reporting API
use JSON;
use LWP::UserAgent;
use Net::Google::WebmasterTools::Request;
use Net::Google::WebmasterTools::R
my $json = to_json( \%params );
my $http_req = HTTP::Request->new( 'POST', $uri->as_string );
$http_req->header(@auth_params);
$http_req->header( 'Content-Type' => 'application/json' );
$http_req->content($json);
if ( ( $req->report_name eq 'sitemaps' ) && ( $req->method eq 'list' ) ) {
$http_req = HTTP::Request->new( 'GET', $uri->as_string );
}
elsif ( ( $r
necessary to
bulk index the instance of an L<eris::log> object as an array of new-line delimited
JSON.
=head2 to_document()
Takes an instance of an L<eris::log> to index into ElasticSearch.
Using