$self->client->status ) {
when ('200') {
# all good
return decode_json($self->client->content);
}
default {
# throw exception
}
der => '_build_endpoints',
);
sub _build_endpoints {
my $self = shift;
# TODO should decode the content
# $self->_endpoints(decode_json($self->client->GET($self->_self_endpoint)));
}
1;
ge Neo4j::Index;
use strict;
use warnings;
use 5.10.0;
use Moose;
use Neo4j::REST::Client;
use JSON;
has 'client' => (
required => 1,
isa => 'Neo4j::REST::Client',
is => 'r
ict;
use warnings;
use Moose;
use Neo4j::REST::Client;
use Neo4j::Node;
use Data::Printer;
use JSON;
has 'id' => (
isa => 'Num',
required => 0,
is => 'rw',
);
has 'client'
for ( $self->client->status ) {
when ('200') {
$self->_endpoints( decode_json( $self->client->content ) );
$self->_self_endpoint( $self->_endpoints->{self} );
;
$self->client->POST($url, encode_json( $payload) );
for ( $self->client->status ) {
when ('201') {
$self->_endpoints( decode_json( $self->client->content ) );
package Neo4j::REST::Client;
use 5.10.0;
use Moose;
use Data::Printer;
use REST::Client;
use JSON;
use Try::Tiny;
has 'root_URL' => (
required => 1,
isa => 'Str',
is => 'rw',
:Client->new;
$client->addHeader( 'Accept', 'application/json' );
$client->addHeader( 'Content-Type', 'application/json' );
return $client;
}
has 'root_endpoints' => (
isa =
);
$self->GET($self->root_URL);
if($self->status eq '200') {
my $root_endpoints = decode_json($self->content);
# FIX for missing relationships endpoint on the API
$root_endpoints->{re
use 5.10.0;
use Moose;
use Neo4j::Relationship;
use Neo4j::REST::Client;
use Data::Printer;
use JSON;
has 'id' => (
isa => 'Num',
required => 0,
is => 'rw',
);
has 'client'
for ( $self->client->status ) {
when ('200') {
$self->_endpoints( decode_json( $self->client->content ) );
$self->_self_endpoint( $self->_endpoints->{self} );
t('node'),
encode_json( $self->data ) );
for ( $self->client->status ) {
when ('201') {
# all good
$self->_endpoints( decode_json( $self->client->content