tem * C<<< 201 >>> - data, type: application/json
a JSON representation of the newly created branch
=item * C<<< 400 >>> - errors, type: application/json
the branch was not created because the requ
, or was not a valid ref name in the
repository
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insufficient permissions to create a
branch. This could be
/{repositorySlug}/branches
Responses:
=over 4
=item * C<<< 400 >>> - errors, type: application/json
the branch was not deleted because the request was invalid, e.g. no ref name
to delete was provi
ment.
=cut
package AnyEvent::MP::Config;
use common::sense;
use Carp ();
use AnyEvent ();
use JSON::XS ();
our $VERSION = '2.02';
our $CONFIG_FILE = exists $ENV{PERL_ANYEVENT_MP_RC} ? $ENV{PERL_
pen my $fh, "<:raw", $CONFIG_FILE) {
return if eval {
local $/;
%CFG = %{ JSON::XS->new->utf8->relaxed->decode (scalar <$fh>) };
1
};
}
%CFG = (
ver
$fh, ">:raw", "$CONFIG_FILE~new~"
or Carp::croak "$CONFIG_FILE~new~: $!";
syswrite $fh, JSON::XS->new->pretty->utf8->encode (\%CFG) . "\n"
or Carp::croak "$CONFIG_FILE~new~: $!";
c
rd.
=item Create a sandbox_config.json
On the dashboard page of your new sandbox account, three are three values you
will need to put into a C<< sandbox_config.json >>. The format of the file must
ere you need to know the source node ID.
=cut
sub _inject {
warn "RCV $SRCNODE -> " . eval { JSON::XS->new->encode (\@_) } . "\n" if TRACE && @_;
&{ $PORT{+shift} or return };
}
# this funct
sub snd(@) {
my ($nodeid, $portid) = split /#/, shift, 2;
warn "SND $nodeid <- " . eval { JSON::XS->new->encode ([$portid, @_]) } . "\n" if TRACE && @_;
($NODE{$nodeid} || add_node $nodeid
our $sv_eq_coder = JSON::XS->new->utf8->allow_nonref;
# are the two scalars equal? very very ugly and slow, need better way
sub sv_eq($$) {
ref $_[0] || ref $_[1]
? (JSON::XS::encode $sv_eq
C<<< 200 >>> - pullRequest, type: application/json
The rebaseability status of the pull request.
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insuffic
permissions to view the
specified pull request.
=item * C<<< 404 >>> - errors, type: application/json
The specified repository or pull request does not exist.
=back
=head2 rebase
Rebases the spec
4
=item * C<<< 200 >>> - pullRequest, type: application/json
The merged pull request.
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insufficient permi
package Net::SugarCRM::Entry;
use warnings;
use strict;
use JSON;
our $VERSION = sprintf "3.%05d", q$Revision: 20471 $ =~ /(\d+)/xg;
=head1 Net::SugarCRM::Entry
Represens an entry from Sugar
=hea
{value};
$self->{name_value_list}{$field}{value} = $_[0] if ($#_ > -1);
if (ref $ret eq 'JSON::XS::Boolean') {
$ret = '';
}
return $ret;
} else {
confess("$field: No
to the
receiving port.
The type of data you can transfer depends on the transport protocol: when
JSON is used, then only strings, numbers and arrays and hashes consisting
of those are allowed (no obj
a single
code reference stored in a global hash - it can't become much cheaper.
=item Why favour JSON, why not a real serialising format such as Storable?
In fact, any AnyEvent::MP node will happily
Storable by
default (although all nodes will accept it).
The default framing protocol is JSON because a) JSON::XS is many times
faster for small messages and b) most importantly, after years of
exper
{
my $self = shift;
my $uri = $self->client->base_uri;
return $self->client->decoded_json_for( uri => $uri . $self->href );
}
my $parser = DateTime::Format::Strptime->new( pattern => '%Y
$self = shift;
return 0 unless $self->_has_next_href;
my $raw = $self->client->decoded_json_for(
uri => $self->client->base_uri . $self->_next_href );
push @{ $self->_items },
my $formatted = eval {
require JSON::MaybeXS;
my $json = JSON::MaybeXS->new(canonical => 1, pretty => 1, utf8 => 1);
$json->encode($json->decode($text));
} || $text;
UA->new(ua => $self->ua);
},
);
has json => (
is => 'lazy',
isa => Object,
default => sub {
load JSON::MaybeXS;
JSON::MaybeXS->new(utf8 => 1);
},
);
ha
args->{url});
my %options;
$options{headers}{Accept} = '*/*;q=0.2,application/json'; # prefer json response
$self->_call_add_authorization($args, \%options);
# request body
my $data = $args->{data};
my $data_type = $args->{data_type} || 'application/json';
if ($data) {
if ($method eq 'GET' || $method eq 'HEAD') {
my $params = ref($
a list of Perl
strings, numbers, hashes and arrays, anything that can be expressed as a
L<JSON> text (as JSON is the default serialiser in the protocol). Here are
two examples:
write_log => 1251
;
use Moose;
use Log::Log4perl qw(:easy);
use LWP::UserAgent;
use DateTime;
use Time::HiRes;
use JSON;
use Data::Dumper;
use Readonly;
use Try::Tiny;
use HTTP::Request::Common;
use DBI;
use Carp qw(c
$VERSION",
keep_alive => 1,
);
$globalua->default_header('Accept' => 'application/json');
return $globalua;
}
=head2 application
The application name to be used for the rest meth
od, $rest_data) = @_;
my $res = $self->_rest_request_no_json($method, $rest_data);
my ($response, $msg) = try {
return(JSON->new->decode($res->content), 0);
} catch {
retu
package GCloud::CLIWrapper;
use Moose;
use JSON::MaybeXS;
use IPC::Open3;
use GCloud::CLIWrapper::Result;
our $VERSION = '0.01';
has gcloud => (is => 'ro', isa => 'Str', default => 'gclo
$self->input(undef, @command);
}
sub json {
my ($self, @command) = @_;
my $result = $self->run(@command);
my $struct = eval {
JSON->new->decode($result->output);
};
GCloud::CLIWrapper::Result->new(
rc => $result->rc,
output => $result->output,
json => $struct
);
}
sub input {
my ($self, $input, @params) = @_;
my @final_comma
=over 4
=item * C<<< 200 >>> - data, type: application/json
The newly created access key
=item * C<<< 400 >>> - errors, type: application/json
The current request contains invalid or missing value
missions to add an access
key to the repository
=item * C<<< 404 >>> - errors, type: application/json
The specified repository does not exist
=back
=head2 get_keys_for_repository
Retrieves the ac
item * C<<< 200 >>> - page, type: application/json
A single page of access keys for the repository.
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insuff
ild-status/1.0/commits/stats
Responses:
=over 4
=item * C<<< 200 >>> - data, type: application/json
The number of successful/failed/in-progress builds for each commit
(with the caveat that the com
h
them >>> will not be present in the response)
=item * C<<< 401 >>> - errors, type: application/json
The user is not authenticated or does not have the B<<< LICENSED >>> permission.
=back
=head2
<< 200 >>> - data, type: application/json
The number of successful/failed/in-progress builds for the commit
=item * C<<< 401 >>> - errors, type: application/json
The user is not authenticated or do
e v5.10;
use strict;
use warnings;
use namespace::autoclean;
our $VERSION = '0.04';
use Cpanel::JSON::XS;
use Data::Visitor::Callback;
use HTTP::Request;
use LWP::UserAgent;
use String::CamelSnakeKe
ervice::TeamCity::Entity::Project;
use WebService::TeamCity::Types qw( BuildStatus DateTimeObject JSONBool );
use Moo;
has scheme => (
is => 'ro',
isa => Str,
default => 'http',
{ LWP::UserAgent->new },
);
has _json => (
is => 'ro',
isa => InstanceOf ['Cpanel::JSON::XS'],
lazy => 1,
default => sub { Cpanel::JSON::XS->new },
);
with 'WebService::
er 4
=item * C<<< 200 >>> - page, type: application/json
The audit events for this project
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insufficient p
ermissions to administer the
project.
=item * C<<< 404 >>> - errors, type: application/json
The specified project does not exist.
=back
=head2 get_events_for_repository
Retrieve the subset of aud
r 4
=item * C<<< 200 >>> - page, type: application/json
The audit events for this repository
=item * C<<< 401 >>> - errors, type: application/json
The currently authenticated user has insufficient
hift;
my $items_key = shift;
my $class = shift;
my $raw = $self->client->decoded_json_for( uri => $uri );
my %args = (
client => $self->client,
class => 'W
flates REST API objects from JSON
__END__
=pod
=encoding UTF-8
=head1 NAME
WebService::TeamCity::Inflator - Role for any class that inflates REST API objects from JSON
=head1 VERSION
version 0.
r $VERSION = '0.04';
use Type::Library
-base,
-declare => qw( BuildStatus DateTimeObject JSONBool TestStatus );
use Type::Utils qw( class_type enum union );
enum BuildStatus, [qw( SUCCESS FA
m TestStatus, [qw( SUCCESS FAILURE UNKNOWN )];
class_type DateTimeObject, { class => 'DateTime' };
union JSONBool, [
class_type('JSON::PP::Boolean'),
class_type('JSON::XS::Boolean'),
];
1;