$issue->get;
...
}
}
my $issue = $ff->issue( $id );
my $json = $issue->to_json;
# third party API:
my $ff = Business::Fixflo->new(
api_key => $
se strict;
use warnings;
use Moo;
use JSON ();
use Carp qw/ cluck /;
with 'Throwable';
=head1 ATTRIBUTES
=head2 message (required)
The error message, if JSON is passed this will be coerced to a s
ta to a file as it may contain
sensitive information such as API key(s).
=cut
# plain string or JSON
has message => (
is => 'ro',
required => 1,
coerce => sub {
my ( $mes
# defensive decoding
eval { $message = JSON->new->decode( $message ) };
$@ && do { return "Failed to parse JSON response ($message): $@"; };
if ( ref( $mess
ut extend it instead.
=cut
use strict;
use warnings;
use Moo;
use Carp qw/ confess carp /;
use JSON ();
use Try::Tiny;
use Business::Fixflo::Paginator;
=head1 ATTRIBUTES
client
url
ur
the object.
my %data = $Issue->to_hash;
=head2 to_json
Returns a json string representation of the object.
my $json = $Issue->to_json;
=head2 get
Populates the object with its attributes
);
delete( $hash{warn_unknown_attributes} );
return %hash;
}
sub to_json {
my ( $self ) = @_;
return JSON->new->canonical->encode( { $self->to_hash } );
}
sub get {
my ( $self )
$issue->get;
...
}
}
my $issue = $ff->issue( $id );
my $json = $issue->to_json;
# third party API:
my $ff = Business::Fixflo->new(
api_key => $
te( $update,'Landlord',sub {
my ( $self ) = @_;
$self->Id or $self->Id( undef ); # force Id of null in JSON
return { $self->to_hash };
} );
}
1;
# vim: ts=4:sw=4:et
Media',sub {
my ( $self ) = @_;
$self->Id or $self->Id( undef ); # force null in JSON request
return { $self->to_hash };
} );
}
sub download {
my ( $self ) = @_;
Business::Fixflo::QuickViewPanel;
use MIME::Base64 qw/ encode_base64 /;
use LWP::UserAgent;
use JSON ();
use Carp qw/ carp confess /;
=head1 ATTRIBUTES
=head2 username
Your Fixflo username (requi
LETE/ ) {
if ( $params ) {
$req->content_type( 'application/json' );
$req->content( JSON->new->encode( $params ) );
carp( $req->content )
i
s->content;
if ( $res->headers->header( 'content-type' ) =~ m!application/json! ) {
$data = JSON->new->decode( $data );
}
return $data;
}
else {
pagination through fixflo data returned as a list.
=cut
use strict;
use warnings;
use Moo;
use JSON ();
use Business::Fixflo::Issue;
=head1 ATTRIBUTES
client
objects
class
links
,sub {
my ( $self ) = @_;
$self->Id or $self->Id( undef ); # force Id of null in JSON
return { $self->to_hash };
} );
}
sub property {
my ( $self ) = @_;
my $Pro
Draft',sub {
my ( $self ) = @_;
$self->Id or $self->Id( undef ); # force null in JSON request
my $post_data = { $self->to_hash };
if ( $self->Address ) {
#!/opt/tools/bin/perl
use strict;
use warnings;
use Mojolicious::Lite;
use Mojo::JSON qw/ decode_json encode_json /;
use Readonly;
use FindBin qw/$Bin/;
use lib $Bin;
$ENV{MOJO_LOG_LEVEL} = 'fatal
_found;
my @items = map { $entity_item->( $_,undef,$url ) } $start .. $end;
$self->render(
json => {
PreviousURL => $prev ? "$uri?page=$prev" : undef,
NextURL => "$uri?page=
$url ) } $start .. $end;
my $total_pages = $do_next_page ? $next : $prev + 1;
$self->render(
json => {
PreviousURL => $prev ? "$uri?page=$prev" : undef,
NextURL => $do_next_page ? "$u