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::
$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 },
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.
{
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
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;