=head1 SYNOPSIS
use Webservice::OVH;
my $ovh = Webservice::OVH->new_from_json("credentials.json");
my $available_services = $ovh->order->email->domain->available_services;
=h
package MooseX::Storage::Format::JSONpm 0.093094;
use MooseX::Role::Parameterized;
# ABSTRACT: a format role for MooseX::Storage using JSON.pm
#pod =head1 SYNOPSIS
#pod
#pod package Point;
#pod u
se Moose;
#pod use MooseX::Storage;
#pod
#pod with Storage(format => 'JSONpm');
#pod
#pod has 'x' => (is => 'rw', isa => 'Int');
#pod has 'y' => (is => 'rw', isa => 'Int');
#pod
#pod 1;
#pod
lass into a JSON string
#pod my $json = $p->freeze(); # { "__CLASS__" : "Point", "x" : 10, "y" : 10 }
#pod
#pod # unpack the JSON string into an object
#pod my $p2 = Point->thaw($json);
#pod
#po
'0.004'; # VERSION
our $rschema = do{my$var={base=>"any",clsets_after_base=>[{of=>[["array_from_json",{elems=>[["str",{match=>"\\A(?:[A-Za-z_][A-Za-z_0-9]*(::[A-Za-z_0-9]+)*(?:=.*)?)\\z","x.completi
history> are mapped to database
#pod columns. The entire argument is also stored in one field as JSON, and a few
#pod other attributes are always required (like C<by_whom>) and some are added just
#p
<add_history> are mapped to database
columns. The entire argument is also stored in one field as JSON, and a few
other attributes are always required (like C<by_whom>) and some are added just
in time
um_version_from_metayml_ok
all_minimum_version_from_metajson_ok
all_minimum_version_from_mymetayml_ok
all_minimum_version_from_mymetajson_ok
);
sub import {
my($self) = shift;
my $pack = ca
rsion_from_metajson_ok
#pod
#pod all_minimum_version_from_metajson_ok(\%arg);
#pod
#pod This routine checks F<META.json> for an entry in F<requires> for F<perl>. If
#pod no META.json file or no per
een
#pod called with that version.
#pod
#pod =cut
sub all_minimum_version_from_metajson_ok { __from_meta('META.json', @_); }
#pod =func all_minimum_version_from_mymetayml_ok
#pod
#pod all_minimum_
ment> 3.22
Version 3.22 required because: has proper XML escaping
=head3 L<IO::Async>
=head3 L<JSON::MaybeXS>
=head3 L<List::AllUtils>
=head3 L<Log::Dispatchouli> 2.000
Version 2.000 required be
use in another program, for example in a web
#pod browser receiving a serialized Throwable::X via JSON in response to an
#pod XMLHTTPRequest.
#pod
#pod {
#pod ident => $err->ident,
#pod me
and use in another program, for example in a web
browser receiving a serialized Throwable::X via JSON in response to an
XMLHTTPRequest.
{
ident => $err->ident,
message => $err->message_f
JSON qw//;
use Class::Accessor::Lite (
ro => [qw/
api_base
access_key
secret_key
/],
rw => [qw/
client
sign
timestamp
decode_json
croak "require 'access_key' and 'secret_key'.";
}
my $self = bless {
decode_json => 0,
api_base => 'https://api.bitflyer.jp',
%args,
}, $class;
$self-
__ . "/$VERSION",
default_headers => {
'Content-Type' => 'application/json',
'ACCESS-KEY' => $self->access_key,
},
timeout => 15,
my @data;
push @data, $headers->to_hash(1);
push @data,
exists $params->{json} ? (json => $params->{json})
: exists $params->{form} ? (form => $params->{form})
: exists $params->{b
'bar', # Default: "example.com"
# Only one of these can be present
json => {...}, # JSON HTTP body
form => {key => $value}, # Form data
body => '...',
warnings;
package Test::Deep::JType 0.008;
# ABSTRACT: Test::Deep helpers for JSON::Typist data
use JSON::PP ();
use JSON::Typist ();
use Test::Deep 1.126 (); # LeafWrapper, as_test_deep_cmp
use Exp
y for testing data structures.
#pod Test::Deep::JType extends it with routines for testing
#pod L<JSON::Typist>-annotated data.
#pod
#pod By default, Test::Deep's C<cmp_deeply> will interpret plain nu
eans that this test
#pod won't work:
#pod
#pod my $json = q[ { "key": "value" } ];
#pod my $data = decode_json($json);
#pod my $typed = JSON::Typist->new->apply_types( $data );
#pod
#pod cmp
e that look at the declared dependencies in distributions'
metadata files (C<META.yml> and C<META.json>).
=back
=head2 Introspectors
L<App::FatPacker::Trace> and L<Devel::Dependencies>
just gives a
package XML::Loy::XRD;
use strict;
use warnings;
use Mojo::JSON qw/encode_json decode_json/;
use Mojo::Util 'quote';
use Carp qw/carp/;
use XML::Loy::Date::RFC3339;
use XML::Loy with => (
mime
ert to xml
sub _to_xml {
my $xrd = shift;
# Parse json document
my $jrd;
# There may be a parsing error
eval {
$jrd = decode_json $_[0];
} or carp $@;
# Itterate over all XRD elem
if ($key eq 'titles') {
_to_xml_titles($xrd, $jrd->{$key});
};
};
};
# Convert From JSON to XML
sub _to_xml_titles {
my ($node, $hash) = @_;
foreach (keys %$hash) {
# Default
might not be totally insane
use Carp ();
use DBI;
use Data::GUID ();
use DBIx::Locker::Lock;
use JSON 2 ();
use Sys::Hostname ();
#pod =head1 DESCRIPTION
#pod
#pod ...and a B<warning>.
#pod
#pod DBI
#pod
#pod This method attempts to return a new DBIx::Locker::Lock.
#pod
#pod =cut
my $JSON;
BEGIN { $JSON = JSON->new->canonical(1)->space_after(1); }
sub lock {
my ($self, $lockstring, $arg) = @_
lockstring,
$self->_time_to_string,
$self->_time_to_string([ localtime($expires) ]),
$JSON->encode($locked_by),
);
die(
"could not lock resource <$lockstring>" . (
$dbh->err
warnings;
use Carp ();
use Digest::SHA qw(hmac_sha256_hex);
use Exporter qw(import);
use JSON::XS qw(decode_json);
our @EXPORT_OK = qw( create_signature is_signature_valid );
our $SIG_VALID_FOR_SEC
$time ||= time;
my $req_time = ref($params) ? $params->{time}
: decode_json($params)->{time};
return if not $req_time;
return if $req_time < ($time - $SIG_VALID_FOR
bService::DS::SOP::Auth::V1_1::Request::POST_JSON;
use WebService::DS::SOP::Auth::V1_1::Request::PUT;
use WebService::DS::SOP::Auth::V1_1::Request::PUT_JSON;
use WebService::DS::SOP::Auth::V1_1::Util
UserAgent->new->request($req);
When making a POST request with JSON data to API:
my $req = $auth->create_request(
POST_JSON => 'http://<API_HOST>/path/to/endpoint' => {
hoge
w-form-urlencoded>.
=item C<POST_JSON>
For HTTP POST request to SOP endpoint with signature as request header
C<X-Sop-Sig> of request content type C<application/json>.
=item C<PUT>
For HTTP PUT re
t Mojolicious version > 7.77
# - "ns|*" namespace selector
#
# - Add ->clone
# (Maybe via JSON serialisation of ->tree or using Storable or Dumper)
#
# Maybe necessary: *AUTOLOAD = \&XML::Lo
e parts
#pod using L<Template Toolkit 2|Template>. When specifying a renderer in
#pod F<manifest.json>, you might write something like this:
#pod
#pod { ..., "renderer": "TT" }
#pod
#pod Or, to sup
ers message parts
using L<Template Toolkit 2|Template>. When specifying a renderer in
F<manifest.json>, you might write something like this:
{ ..., "renderer": "TT" }
Or, to supply options:
{
s ();
#pod =for Pod::Coverage assemble BUILD
#pod
#pod =head1 SYNOPSIS
#pod
#pod In your mkit's (JSON, here) manifest:
#pod
#pod {
#pod "renderer" : "TT",
#pod "assembler": [
#pod "Ma
is => 'ro',
isa => 'Str',
);
has munge_signature => (
is => 'ro',
# XXX Removed because JSON booly objects (and YAML?) aren't consistently
# compatible with Moose's Bool type. -- rjbs, 201
=> 'Bool',
default => 0,
);
has render_wrapper => (
is => 'ro',
# XXX Removed because JSON booly objects (and YAML?) aren't consistently
# compatible with Moose's Bool type. -- rjbs, 201
fix => 'activity',
namespace => 'http://activitystrea.ms/schema/1.0/'
);
# Todo: support to_json
# Todo: verbs and object-types may need namespaces
# Todo: Support ActivityStreams 2 as a anamesp
L<Mojolicious>.
=head1 LIMITATIONS
L<XML::Loy::ActivityStreams> has currently no support for
JSON serialization, neither on reading nor writing.
=head1 AVAILABILITY
https://github.com/Akron/
-strict, -signatures;
use overload ();
use Exporter qw(import);
use Mojo::File;
use Mojo::JSON qw(encode_json);
our @EXPORT_OK = qw(logf safe_id);
our $STDERR = \*STDERR; # useful for t
evel, $module_name,
map { overload::Method($_, q("")) ? "$_" : !defined $_ || ref $_ ? encode_json $_ : $_ } @args;
return 1;
}
sub safe_id ($str) {
$str =~ s![^A-Za-z0-9]!_!g;
$str =~ s!_+
, "fatal". Any references and undefined values in C<@args> will be
serialized using L<Mojo::JSON/encode_json>.
=head2 safe_id
$str = safe_id $str;
Turns an "unsafe" string into a string you can u