TS = (
ttl => 'Turtle',
nt => 'NTriples',
n3 => 'Notation3',
json => 'RDFJSON',
rdfxml => 'RDFXML'
);
has base_dir => (
is => 'ro', required => 1,
isa =>
zation format (See L<Plack::Middleware::Negotiate>). Supported
values are C<ttl>, C<nt>, C<n3>, C<json>, and C<rdfxml>.
=back
If an existing resource does not contain triples, the axiomatic triple
C
],
['config|c=s' => "configuration file (default: ./paia.json)"],
['session|s=s' => "session file (default: ./paia-session.json)"],
['verbose|v' => "show what's going on internally"]
P::CLI;
use Moose;
with 'MooseX::SimpleConfig';
with 'MooseX::Getopt';
use Net::PMP::Client;
use JSON;
use Data::Dump qw( dump );
our $VERSION = '0.006';
has '+configfile' =>
( default => $ENV{
ag --tag foo
get --path /path/to/resource
groups
put --file /path/to/resource.json
users
EOF
return $txt;
}
sub _list_items {
my ( $self, $label, $urn ) = @_;
my $
client->last_response->status_line );
}
else {
#dump $doc;
print $doc->as_json;
}
}
=head2 put([I<filename>])
Reads I<filename> and PUTs it to the server. If missing, the
WP::UserAgent 6; # SSL verification bug fixed in 6.03
use HTTP::Request;
use MIME::Base64;
use JSON;
use Net::PMP::AuthToken;
use Net::PMP::CollectionDoc;
use Net::PMP::Schema;
use Net::PMP::Creden
(
is => 'rw',
isa => 'Str',
default => sub {'application/vnd.collection.doc+json'},
);
has 'last_response' => ( is => 'rw', isa => 'HTTP::Response', );
# TODO add strict mode wh
a
A LWP::UserAgent object.
=item pmp_content_type
Defaults to C<application/vnd.collection.doc+json>. Change at your peril.
=back
=head2 BUILD
Internal method for object construction.
=head2 la
se Net::PMP::CollectionDoc::Links;
use Net::PMP::CollectionDoc::Items;
use UUID::Tiny ':std';
use JSON;
use Try::Tiny;
our $VERSION = '0.006';
# the 'required' flag on these attributes should match
'ro', isa => 'ArrayRef', required => 0, );
=head1 NAME
Net::PMP::CollectionDoc - Collection.doc+JSON object for Net::PMP::Client
=head1 SYNOPSIS
my $doc = $pmp_client->get_doc();
printf("API ver
sents the PMP API media type L<https://github.com/publicmediaplatform/pmpdocs/wiki/Collection.doc-JSON-Media-Type>.
=head1 METHODS
=head2 href
The unique identifier. See L<http://cdoc.io/spec.html#
META files:
=over 4
=item L<Test-CPAN-Meta|Test::CPAN::Meta>
=item L<Test-CPAN-Meta-JSON|Test::CPAN::Meta::JSON>
=item L<Test-CPAN-Meta-YAML|Test::CPAN::Meta::YAML>
=back
All three have slightly
eta-JSON|Test::CPAN::Meta::JSON> is the most recent addition to the family, and is specifically
aimed at those distributions that use a F<META.json> Meta file. The distribution
requires the L<JSON> mo
E ALSO
=over 4
=item L<Test::YAML::Valid>
=item L<Test::CPAN::Meta>
=item L<Test::CPAN::Meta::JSON>
=item L<Test::CPAN::Meta::YAML>
=back
=head1 AUTHOR
Barbie, <barbie@cpan.org>
for Miss Barbe
ref);
}
=head1 DESCRIPTION
Net::PMP::CollectionDoc::Link represents a link in a Collection.doc+JSON PMP API response.
=head1 METHODS
=head2 hints
=head2 href
=head2 title
=head2 rels
=head2 v
;
}
=head1 DESCRIPTION
Net::PMP::CollectionDoc::Links represents the links in a Collection.doc+JSON PMP API response.
=head1 METHODS
=head2 links
Returns arrayref of links.
=head2 type
The fla
d1 DESCRIPTION
Net::PMP::CollectionDoc::Permission represents a special link in a Collection.doc+JSON PMP API response.
See L<https://github.com/publicmediaplatform/pmpdocs/wiki/Permissions-Design>.
set, will be output as a scalar
reference to an integer, so that passing to encode_json() will create a proper JSON boolean.
=head1 AUTHOR
Peter Karman, C<< <karman at cpan.org> >>
=head1 BUGS
Pl
FILES
There are currently 3 distributions to test META files:
Test-CPAN-Meta
Test-CPAN-Meta-JSON
Test-CPAN-Meta-YAML
All three have slightly different requirements and are intended to be used
s.
Test-CPAN-Meta-JSON is the most recent addition to the family, and is specifically
aimed at those distributions that use a META.json Meta file. The distribution
requires the JSON module to parse t
ict;
use v5.10;
our $VERSION = '0.30';
use App::PAIA::JSON;
our %DEFAULT = (
'config' => 'paia.json',
'session' => 'paia-session.json'
);
sub new {
my $class = shift;
my $self = b
$fh, '<', $file)
or die "failed to open $type file $file\n";
$self->{data} = decode_json(<$fh>,$file);
close $fh;
$self->{logger}->("loaded $type file $file");
$sel
(my $fh, '>', $file)
or die "failed to open $type file $file\n";
print {$fh} encode_json($self->{data});
close $fh;
$self->{logger}->("saved $type file $file");
}
sub purge {
package Email::SendGrid::Header;
use strict;
use JSON;
use MIME::Entity;
sub new
{
my $class = shift;
my $self = bless { 'data' => { },
@_
}, $class;
, $self->asJSON());
$mime->head->fold('x-smtpapi');
}
sub asJSON
{
my $self = shift;
my %args = @_;
my $json = JSON->new;
$json->space_before(1);
$json->space_after(1);
$json->ascii(1)
;
my $str = $json->encode($self->{data});
if ( $args{fold} )
{
my $length = $args{fold};
$str =~ s/(.{1,$length})(\s)/$1\n$2/g;
}
return $str;
}
=head1 NAME
Email::SendGrid::Head
ode
stdout_json stderr_json output_json error exit_code
));
use Test::More;
use App::Cmd::Tester;
use File::Temp qw(tempdir);
use Cwd;
use App::PAIA;
use JSON::PP qw(encode_json);
use Scalar:
;
sub decode_json {
my $json = shift;
$json =~ s/^#.*$//mg;
JSON::PP::decode_json($json)
}
sub stdout_json() { decode_json($RESULT->stdout) }
sub stderr_json() { decode_json($RESULT->std
err) }
sub output_json() { decode_json($RESULT->output) }
## no critic
eval "sub $_() { \$RESULT->$_ }" for qw(stdout stderr output error exit_code);
our $HTTP_TINY_REQUEST = \&HTTP::Tiny::request;
nt;
use strict;
use v5.10;
our $VERSION = '0.30';
use HTTP::Tiny 0.024;
use URI;
use App::PAIA::JSON;
sub new {
my ($class, %options) = @_;
bless {
insecure => !!$options{insecure},
) // '';
my $param = shift // {};
my $headers = {
Accept => 'application/json',
'User-Agent' => "App::PAIA/".($APP::PAIA::VERSION//'?'),
@_
};
my $con
}
if ($method eq 'POST') {
$headers->{'Content-Type'} = 'application/json';
$content = encode_json($param);
} elsif (%$param) {
$url->query_form(%$param);
}
$
;
use strict;
use v5.10;
use parent 'App::PAIA::Command';
our $VERSION = '0.30';
use App::PAIA::JSON;
sub usage_desc {
"%c config %o [ key [value] ]"
}
sub opt_spec {
['ini|i' => 'list con
- show or modify configuration
=head1 DESCRIPTION
This command shows or modifies the current configuration. Configuration
is printed as JSON object or in INI-sytle as sorted key-value-pairs.
=cut
;
use strict;
use v5.10;
use parent 'App::PAIA::Command';
our $VERSION = '0.30';
use App::PAIA::JSON;
sub _execute {
my ($self, $opt, $args) = @_;
if ($self->expired) {
$self->logg
"POST", "$auth/logout", { patron => $self->patron }
);
print encode_json($response);
}
$self->session->purge && $self->logger->("deleted session file");
ret
';
use App::PAIA::JSON;
sub _execute {
my ($self, $opt, $args) = @_;
if (defined $self->session->file ) {
my $data = $self->session->load;
say encode_json($data) if $self->a
;
use strict;
use v5.10;
use parent 'App::PAIA::Command';
our $VERSION = '0.30';
use App::PAIA::JSON;
sub _execute {
my ($self, $opt, $args) = @_;
$self->core_request('GET', 'items');
}
1
.
engines:
template_flute:
iterators:
fruits:
class: JSON
file: fruits.json
=head2 FILTER OPTIONS
Filter options and classes can be specified in the configur
does not propagate to nested definitions.
=head1 CREDIT
This was inspired by the JSON Generator L<http://www.json-generator.com/>.
=head1 DEPENDENCIES
No non-core modules are required.
=head1