ne/api/v1.40/#operation/ImageList
sub get_images ($self) {
return $self->_req( 'GET', 'images/json' );
}
# https://docs.docker.com/engine/api/v1.40/#operation/ImageBuild
sub image_build ( $self,
id );
for my $stream ( split /\r\n/sm, $res->{data}->$* ) {
my $data = P->data->from_json($stream);
$log .= $data->{stream} if exists $data->{stream};
if ( exists $data-
headers => [
'X-Registry-Auth' => P->data->to_b64(
P->data->to_json( {
username => $username,
password => $token,
sername}:$self->{token}", $EMPTY )
],
);
my $data = $res->{data} ? P->data->from_json( $res->{data} ) : undef;
if ($res) {
$self->{_token} = $data->{token};
retu
ation => "Bearer $self->{_token}",
],
);
my $data = $res->{data} ? P->data->from_json( $res->{data} ) : undef;
if ($res) {
return res 200, $data;
}
else {
ept => 'application/vnd.docker.distribution.manifest.v2+json',
],
);
my $data = $res->{data} ? P->data->from_json( $res->{data} ) : undef;
if ($res) {
$data->{dige
a => $self->{data},
};
$node->write( P->data->to_json($msg) . "\n" );
my $res = $node->read_line;
$res = P->data->from_json($res);
# unable to run elsint
if ( !$res->{statu
};
$node->write( P->data->to_json($msg) . "\n" );
my $res = $node->read_line;
P->text->decode_utf8( $res->$* );
$res = P->data->from_json($res);
# unable to run elsint
};
$node->write( P->data->to_json($msg) . "\n" );
my $res = $node->read_line;
P->text->decode_utf8( $res->$* );
$res = P->data->from_json($res);
if ( !$res->{status} ) {
D__RPerl__DataStructure__MongoDBBSONStandAlone_h 0.002_000
// [[[ INCLUDES ]]]
#include <bsoncxx/json.hpp>
#include <bsoncxx/builder/stream/document.hpp>
# ifndef __CPP__INCLUDED__RPerl__DataStructu
ashref_end bsoncxx::builder::stream::close_document
#define bson_Dumper(my_bson_data) bsoncxx::to_json(*my_bson_data)
// [[[ OO SUBCLASSES ]]]
/* UNUSED?
typedef std::unique_ptr<bson_document> bson_d
package Pcore::API::Chrome::Tab;
use Pcore -class, -res;
use Pcore::Util::Data qw[to_json from_json from_b64];
use Pcore::Util::Scalar qw[weaken];
use Pcore::WebSocket::raw;
use overload #
'&{}
^GLOBAL_PHASE} ne 'DESTRUCT' ) {
my $url = "http://$self->{chrome}->{listen}->{host_port}/json/close/$self->{id}";
Coro::async_pool sub ($url) { P->http->get($url) }, $url;
}
lf->{chrome}->{listen}->{host_port}/json/close/$self->{id}");
}
sub activate ( $self ) {
return P->http->get("http://$self->{chrome}->{listen}->{host_port}/json/activate/$self->{id}");
}
sub lis
ata = P->data->to_json($data) if $data;
my $res = P->http->get(
"https://api.telegram.org/bot$self->{key}/$path",
headers => [ 'Content-Type' => 'application/json', ],
dat
a => $data
);
$data = P->data->from_json( $res->{data} );
return res 200, $data;
}
# TODO
sub set_webhook ( $self, $url, %args ) {
return;
}
sub poll_updates ( $self, $timeout =
::OpenSSL::RSA qw[];
use Pcore::Util::Scalar qw[is_ref];
use Pcore::Util::Data qw[to_b64u to_json from_json to_uri];
has key => ( required => 1 );
has scope => ( required => 1 );
has _token
t_arg => undef );
has _openssl_rsa => ( init_arg => undef );
const our $JWT_HEADER => to_b64u to_json {
alg => 'RS256',
typ => 'JWT',
};
sub BUILD ( $self, $args ) {
$self->{key} = P->cf
my $key = $self->{key};
my $issue_time = time;
my $jwt_claim_set = to_b64u to_json {
aud => 'https://www.googleapis.com/oauth2/v4/token',
iss => $key->{
t-Type' => 'application/json',
$self->{_login_token} ? ( Authorization => 'JWT ' . $self->{_login_token} ) : (),
],
data => $data ? P->data->to_json($data) : undef
);
return res [ $res->{status}, $res->{reason} ], $res->{data} && $res->{data}->$* ? P->data->from_json( $res->{data} ) : ();
}
# USER / NAMESPACE
sub get_user ( $self, $username ) {
return $self-
ML::' => 1,
'I18N::' => 1,
'Inline::' => 1,
'IPC::' => 1,
'JSON::' => 1,
'List::' => 1,
'Lingua::' => 1,
'Locale::' =>
arrayref is_blessed_arrayref];
use Pcore::Util::Digest qw[md5_hex];
use Pcore::Util::Data qw[from_json];
has pool => ( required => 1 ); # InstanceOf ['Pcore::Handle::pgsql']
has is_pgsql => ( 1,
ARRAY ) {
# }
# decode JSON
elsif ( $type == $SQL_JSON ) {
$col = from_json $col;
}
elsif ( looks_
}
elsif ( $param->[0] == $SQL_JSON ) {
$param = $self->encode_json( $param->[1] )->$*;
}
Only for internal usage. Can contain breacking changes. DO NOT USE.
=cut
use REST::Client;
use JSON;
use Carp qw(confess);
use Crypt::JWT qw(encode_jwt);
use Data::UUID;
use Moo;
use plenigo::Ex;
on->access_token);
$client->addHeader('Content-Type', 'application/json');
$client->addHeader('Accept', 'application/json');
return $client;
}
sub _checkResponse {
my ($self, $client
ent->responseCode,
message => decode_json($client->responseContent)->{errorMessage} || 'Bad Request',
errorDetails => decode_json($client->responseContent || '{}'),
});
}
sub
T8RANGE $SQL_INT8RANGEARRAY $SQL_INTERNAL $SQL_INTERVAL $SQL_INTERVALARRAY $SQL_JSON $SQL_JSONARRAY $SQL_JSONB $SQL_JSONBARRAY $SQL_LANGUAGE_HANDLER $SQL_LINE $SQL_LINEARRAY $SQL_LSEG $SQL_LSEGARRAY $
SQL_VOID $SQL_XID $SQL_XIDARRAY $SQL_XML $SQL_XMLARRAY]],
TYPES => [qw[SQL_BYTEA SQL_JSON SQL_UUID SQL_TEXT]],
QUERY => [qw[SQL SET VALUES ON WHERE IN GROUP_BY HAVING ORDER_B
ARRAY => 1187;
const our $SQL_JSON => 114;
const our $SQL_JSONARRAY => 199;
const our $SQL_JSONB => 3802;
const our $SQL_JSONBARRAY => 3807;
const our
ude <mongocxx/instance.hpp>
#include <RPerl/DataStructure/MongoDBBSONStandAlone.h> // -> bsoncxx/json.hpp, bsoncxx/builder/stream/document.hpp
#include <RPerl/Operation/Expression/Operator/MongoDBFun
-class, -ansi;
use Pcore::API::SMTP;
use Pcore::Handle qw[:TLS_CTX];
use Pcore::Util::Data qw[to_json];
use Pcore::Util::Scalar qw[is_ref];
use Time::HiRes qw[];
with qw[Pcore::Core::Event::Listener
data} ) {
# serialize reference
$body = "\n" . ( is_ref $ev->{data} ? to_json $ev->{data}, readable => 1 : $ev->{data} );
# remove all trailing "\n"
l
package Pcore::API::Google::FCM;
use Pcore -class, -res;
use Pcore::Util::Data qw[to_json from_json];
extends qw[Pcore::API::Google::OAuth];
has scope => ( 'https://www.googleapis.com/auth/firebase
tion/json',
Authorization => "Bearer $token->{data}->{access_token}",
],
data => to_json $data
);
if ( !$res ) {
my $error = $res->{data} ? from_json $res
s->{reason} = $error->{error}->{message} if $error;
}
else {
$res = res 200, from_json $res->{data};
}
return $res;
}
1;
__END__
=pod
=encoding utf8
=head1 NAME
Pcore::API
-class, -res;
use Pcore::Util::Scalar qw[is_plain_arrayref];
use Pcore::Util::Data qw[to_uri from_json];
use Pcore::HTTP qw[$UA_CHROME_WINDOWS];
has api_key => (); # direct access to
= $self->{max_threads} && $self->_semaphore->guard;
my $url = 'https://api.majestic.com/api/json?';
if ( $self->{api_key} ) {
$url .= "app_api_key=$self->{api_key}&";
}
elsi
= P->http->get( $url, proxy => $self->{proxy} );
if ($res) {
my $data = eval { from_json $res->{data} };
if ($@) {
$res = res [ 500, 'Error decoding response' ];
get( 'http://httpbin.org/ip', proxy => $self );
if ($res) {
my $data = P->data->from_json( $res->{data} );
return res 200, $data->{origin};
}
else {
return $res;
include directives are set in $RPerl::Inline::ARGS{auto_include} in Compiler.pm
#include <bsoncxx/json.hpp>
#include <bsoncxx/builder/stream/document.hpp>
*/
# ifndef __CPP__INCLUDED__RPerl__DataStru
ashref_end bsoncxx::builder::stream::close_document
#define bson_Dumper(my_bson_data) bsoncxx::to_json(*my_bson_data)
// [[[ OO SUBCLASSES ]]]
/* UNUSED?
typedef std::unique_ptr<bson_document> bson_d
}
# load pardeps.json
my $pardeps;
my $pardeps_path = "$self->{dist}->{root}/share/pardeps-$script-@{[$^V->normal]}-$Config{archname}.json";
if ( -f $pardeps_pa
qq[Script "$script" wasn't found.] . $RESET;
next;
}
# add pardeps.json modules, skip eval modules
$profile->{mod}->@{ grep { !/\A[(]eval\s/sm } $pardeps->@* } =
ge Pcore::API::PDF;
use Pcore -class, -const, -res;
use Config;
use Pcore::Util::Data qw[to_json from_json];
use Pcore::Util::Scalar qw[is_plain_scalarref];
use Pcore::Util::Sys::Proc qw[:PROC_REDIRE
es ? scalar $resources->@* : 0;
# write job
my $json = to_json $job;
$princexml->{stdin}->write( 'job ' . length($json) . "\n$json\n" );
if ($resources) {
for my $resource (