Business-Fixflo

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.12     2015-09-16
        - Add VulnerableOccupiers attribute to Issue object
        - Add undelete method to Agency object
        - Change delete method on Agency object to use POST

0.11     2015-08-07
        - Add PropertyAddressId attribute to Issue object

0.10     2015-07-03
        - Fix Property Issues and Addresses attributes to return objects,
          since calls to this endpoint return a list of json objects and
          not a list or url strings

0.09     2015-07-02
        - Fix Authorization header when using api_key

0.08     2015-07-02
        - Add create_url and search_url to Issue object
        - Change cluck to carp
        - Add perldoc for FIXFLO_DEBUG env variable

Changes  view on Meta::CPAN

        - Add Issues attribute to Property object

0.05     2015-06-04
        - Add get method to QuickViewPanel to make it easy to get at
          the QuickViewPanel's data

0.04     2015-05-27
        - Clarify need to call ->get on Paginator objects in docs

0.03     2015-05-27
        - Fix call to GET Property endpoint

0.02     2015-04-01
        - Fixflo API updates added: Properties, PropertyAddresses, QVP

0.01     2014-12-16
        - First release

README.md  view on Meta::CPAN

    say $e->request->{headers} if $e->request
    say $e->request->{content} if $e->request
}
catch ( $e ) {
    # some other failure?
    ...
}
```

You can view some useful debugging information by setting the FIXFLO\_DEBUG
env varible, this will show the calls to the Fixflo endpoints as well as a
stack trace in the event of exceptions:

```
$ENV{FIXFLO_DEBUG} = 1;
```

# ATTRIBUTES

## username

README.md  view on Meta::CPAN

```

Get a \[list of\] issue(s) / agenc(y|ies) / propert(y|ies) / property address(es) / landlord(s) / landlord\_property:

```perl
my $paginator = $ff->issues( %query_params );

my $issue     = $ff->issue( $id );
```

Will return a [Business::Fixflo::Paginator](https://metacpan.org/pod/Business%3A%3AFixflo%3A%3APaginator) object (when calling endpoints
that return lists of items) or a Business::Fixflo:: object for the Issue,
Agency, etc.

%query\_params refers to the possible query params as shown in the currency
Fixflo API documentation. For example: page=\[n\]. You can pass DateTime objects
through and these will be correctly changed into strings when calling the API:

```perl
# issues raised in the previous month
my $paginator = $ff->issues(

README.pod  view on Meta::CPAN

        say $e->request->{params}  if $e->request
        say $e->request->{headers} if $e->request
        say $e->request->{content} if $e->request
    }
    catch ( $e ) {
        # some other failure?
        ...
    }

You can view some useful debugging information by setting the FIXFLO_DEBUG
env varible, this will show the calls to the Fixflo endpoints as well as a
stack trace in the event of exceptions:

    $ENV{FIXFLO_DEBUG} = 1;

=cut

use strict;
use warnings;

use Moo;

README.pod  view on Meta::CPAN

    property
    property_address
    quick_view_panels

Get a [list of] issue(s) / agenc(y|ies) / propert(y|ies) / property address(es) / landlord(s) / landlord_property:

    my $paginator = $ff->issues( %query_params );

    my $issue     = $ff->issue( $id );

Will return a L<Business::Fixflo::Paginator> object (when calling endpoints
that return lists of items) or a Business::Fixflo:: object for the Issue,
Agency, etc.

%query_params refers to the possible query params as shown in the currency
Fixflo API documentation. For example: page=[n]. You can pass DateTime objects
through and these will be correctly changed into strings when calling the API:

    # issues raised in the previous month
    my $paginator = $ff->issues(
        CreatedSince  => DateTime->now->subtract( months => 1 ),

lib/Business/Fixflo.pm  view on Meta::CPAN

        say $e->request->{params}  if $e->request
        say $e->request->{headers} if $e->request
        say $e->request->{content} if $e->request
    }
    catch ( $e ) {
        # some other failure?
        ...
    }

You can view some useful debugging information by setting the FIXFLO_DEBUG
env varible, this will show the calls to the Fixflo endpoints as well as a
stack trace in the event of exceptions:

    $ENV{FIXFLO_DEBUG} = 1;

=cut

use strict;
use warnings;

use Moo;

lib/Business/Fixflo.pm  view on Meta::CPAN

    property
    property_address
    quick_view_panels

Get a [list of] issue(s) / agenc(y|ies) / propert(y|ies) / property address(es) / landlord(s) / landlord_property:

    my $paginator = $ff->issues( %query_params );

    my $issue     = $ff->issue( $id );

Will return a L<Business::Fixflo::Paginator> object (when calling endpoints
that return lists of items) or a Business::Fixflo:: object for the Issue,
Agency, etc.

%query_params refers to the possible query params as shown in the currency
Fixflo API documentation. For example: page=[n]. You can pass DateTime objects
through and these will be correctly changed into strings when calling the API:

    # issues raised in the previous month
    my $paginator = $ff->issues(
        CreatedSince  => DateTime->now->subtract( months => 1 ),

lib/Business/Fixflo/Client.pm  view on Meta::CPAN

=head1 METHODS

    api_get
    api_post
    api_delete

Make a request to the Fixflo API:

    my $data = $Client->api_get( 'Issues',\%params );

May return a L<Business::Fixflo::Paginator> object (when calling endpoints
that return lists of items) or a Business::Fixflo:: object for the Issue,
Agency, etc.

=cut

sub api_get {
    my ( $self,$path,$params ) = @_;
    return $self->_api_request( 'GET',$path,$params );
}

t/business/fixflo/client.t  view on Meta::CPAN

throws_ok(
    sub { Business::Fixflo::Client->new(
        custom_domain => 'foo',
        password      => 'foo',
    ) },
    qr/api_key or username \+ password required/,
    'Client->new throws api_key or username + password not set'
);

# monkey patching LWP here to make this test work without
# having to actually hit the endpoints or use credentials
no warnings 'redefine';
no warnings 'once';
my $mock = Test::MockObject->new;
$mock->mock( 'is_success',sub { 1 } );
$mock->mock( 'headers',sub { $mock } );
$mock->mock( 'header',sub { 'application/json' } );
$mock->mock( 'content',sub { '{ "Id" : 1 }' } );
*LWP::UserAgent::request = sub { $mock };

cmp_deeply(



( run in 0.710 second using v1.01-cache-2.11-cpan-27979f6cc8f )