package Bio::KBase::InvocationService::Client;
use JSON::RPC::Client;
use strict;
use Data::Dumper;
use URI;
use Bio::KBase::Exceptions;
=head1 NAME
Bio::KBase::InvocationService::Client
=head1 DE
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
package Bio::KBase::GenomeAnnotation::Client;
use JSON::RPC::Client;
use strict;
use Data::Dumper;
use URI;
use Bio::KBase::Exceptions;
=head1 NAME
Bio::KBase::GenomeAnnotation::Client
=head1 DESC
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
rams => \@args,
});
if ($result) {
if ($result->is_error) {
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
code => $result->content->{code},
;
use Lingua::EN::Inflect::Number;
our $RESOURCE_DEBUG = 0;
my $content_types = {
json => 'application/json',
yml => 'text/x-yaml',
xml => 'application/xml',
};
my %routes;
# thanks
(
($conf && exists $conf->{serializers})
? $conf->{serializers}
: { 'json' => 'JSON',
'yml' => 'YAML',
'xml' => 'XML',
'dump' => 'Dumper',
User->find(params->{user_id});
...
}
# curl http://mywebservice/user/42.json
{ "id": 42, "name": "John Foo", email: "john.foo@example.com"}
# curl http://mywebservic
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 GET THE SOURCE
http://code.google.com/p/ebay-api-simpl
ping>
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 AUTHOR
Tim Keefer <tim@timkeefer.com>
=cut
1;
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=head1 GET THE SOURCE
http://code.google.com/p/ebay-api-simpl
=item L<eBay::API::Simple::Trading>
=item L<eBay::API::Simple::HTML>
=item L<eBay::API::Simple::JSON>
=item L<eBay::API::Simple::RSS>
=cut
sub new {
my $class = shift;
my $api_args = s
head2 response_json
Not implemented yet.
=cut
sub response_json {
my $self = shift;
if ( ! defined $self->{response_json} ) {
$self->{response_json} = ''; # xml2json( $self->{respo
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()
:Object;
use Data::Riak::Exception::FunctionFailed;
use Data::Riak::Exception::Timeout;
use JSON 'encode_json';
use namespace::autoclean;
has data => (
is => 'ro',
isa => 'HashRef'
'POST',
uri => 'mapred',
content_type => 'application/json',
data => encode_json($self->data),
($self->chunked ? (query => { chunked => 'true' }) : ())
Data::Riak::Request::GetBucketProps::VERSION = '2.0';
}
use Moose;
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
sub as_http_request_args {
my ($self) = @_;
return {
/props', $self->bucket_name),
accept => 'application/json',
};
}
sub _mangle_retval {
my ($self, $ret) = @_;
$ret->json_value->{props};
}
with 'Data::Riak::Request::WithBucket';
has '+result_class' => (
default => Data::Riak::Result::SingleJSONValue::,
);
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=head1 NAME
Data::Riak::Request::GetBucketProps
=head1 VERS
}
# ABSTRACT: An interface to a Riak server.
use strict;
use warnings;
use Moose;
use JSON::XS qw/decode_json/;
use Data::Riak::Result;
use Data::Riak::ResultSet;
use Data::Riak::Bucket;
use Data:
} @parts
]
});
}
sub _buckets {
my $self = shift;
return decode_json(
$self->send_request({
method => 'GET',
uri => '/buckets',
sage::Passing>, filtering JSON messages into
specified exchanges with specified routeing keys.
=over
=item *
The exchange is specified by the C<@exchange> field in the JSON data.
=item *
The rout
eing key is specified by the C<@rk> field in the JSON data.
=back
=head1 AUTHOR
Dave Lambley, based on work by Tomas (t0m) Doran.
=head1 LICENSE
GNU Affero General Public License, Version 3
=cut
Riak::Role::Bucket;
{
$Data::Riak::Role::Bucket::VERSION = '2.0';
}
use Moose::Role;
use JSON 'decode_json';
use Data::Riak::Link;
use Data::Riak::MapReduce;
use HTTP::Headers::ActionPack::LinkList
_;
my ($result) = $map_reduce_results->results->[0];
my ($count) = decode_json($result->value) || 0;
return $count->[0];
},
);
}
sub linkwalk {
my
index({
%{ $opts || {} },
retval_mangler => sub { [sort map { $_->[1] } @{ decode_json shift }] },
});
}
1;
__END__
=pod
=head1 NAME
Data::Riak::Role::Bucket
=head1 VERSION
Riak::MapReduce::Phase::Map::VERSION = '1.1';
}
use Moose;
use Moose::Util::TypeConstraints;
use JSON::XS ();
# ABSTRACT: Map phase of a MapReduce
with ('Data::Riak::MapReduce::Phase');
has langu
'
);
sub pack {
my $self = shift;
my $href = {};
$href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
$href->{language} = $self->language;
$href->{name}
$Data::Riak::Request::SetBucketProps::VERSION = '2.0';
}
use Moose;
use JSON 'encode_json';
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
has props => (
is => 'ro',
('buckets/%s/props', $self->bucket_name),
content_type => 'application/json',
data => encode_json $self->props,
};
}
with 'Data::Riak::Request::WithBucket';
has '+result_
$Data::Riak::Request::ListBuckets::VERSION = '2.0';
}
use Moose;
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
sub as_http_request_args {
my ($self) = @_;
return {
json',
};
}
sub _mangle_retval {
my ($self, $ret) = @_;
$ret->json_value->{buckets};
}
with 'Data::Riak::Request';
has '+result_class' => (
default => Data::Riak::Result::SingleJSON
Data::Riak::Request::ListBucketKeys::VERSION = '2.0';
}
use Moose;
use Data::Riak::Result::SingleJSONValue;
use namespace::autoclean;
sub as_http_request_args {
my ($self) = @_;
return {
=> 'application/json',
query => {
keys => 'true',
props => 'false',
},
};
}
sub _mangle_retval {
my ($self, $ret) = @_;
$ret->json_value->{keys};
a::Riak::Request::WithBucket';
has '+result_class' => (
default => Data::Riak::Result::SingleJSONValue::,
);
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=head1 NAME
Data::Riak::Reque
k;
use Data::Riak::MapReduce::Phase::Map;
use Data::Riak::MapReduce::Phase::Reduce;
use JSON::XS qw/encode_json/;
with 'Data::Riak::Role::HasRiak';
has inputs => (
is => 'ro',
isa => 'Arra
riak->send_request({
content_type => 'application/json',
method => 'POST',
uri => 'mapred',
data => encode_json({
inputs => $self->inputs,
query
package Message::Passing::Output::AMQP::Proxy;
use Moose;
use namespace::autoclean;
use JSON qw/ decode_json /;
with qw/
Message::Passing::AMQP::Role::HasAChannel
Message::Passing::Role::Outp
erialized data - is a perl reference. Dropping.\n");
return;
}
my $hash = decode_json($data);
$self->_channel->publish(
body => $data,
exchange => $hash->{'@excha
ta::Riak::MapReduce::Phase::Reduce;
use HTTP::Headers::ActionPack::LinkList;
use JSON::XS qw/decode_json encode_json/;
with 'Data::Riak::Role::HasRiak';
has name => (
is => 'ro',
isa => '
ets/%s/keys', $self->name),
query => { keys => 'true' }
})->first;
return decode_json( $result->value )->{'keys'};
}
sub count {
my $self = shift;
my $map_reduce = Data::Ria
ce->mapreduce;
my ( $result ) = $map_reduce_results->results->[0];
my ( $count ) = decode_json($result->value) || 0;
return $count->[0];
}
sub remove_all {
my $self = shift;
my $
;
$self->api_config->{siteid} ||= 0;
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaul
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()