The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Webservice::GAMSTOP::Response - Response object for get_exclusion_for sub

VERSION

version 0.001

SYNOPSIS

    use Webservice::GAMSTOP;
    my $instance = Webservice::GAMSTOP->new(
        api_url => 'gamstop_api_url',
        api_key => 'gamstop_api_key',
        # optional (defaults to 5 seconds)
        timeout => 10,
    );

    my $response = $instance->get_exclusion_for(
        first_name    => 'Harry',
        last_name     => 'Potter',
        email         => 'harry.potter@example.com',
        date_of_birth => '1970-01-01',
        postcode      => 'hp11aa',
    );

    $response->is_excluded;
    $response->get_date;
    $response->get_unique_id;
    $response->get_exclusion;

DESCRIPTION

This object is returned as response for get_exclusion_for.

METHODS

Constructor

new

    use Webservice::GAMSTOP::Response;
    my $response = Webservice::GAMSTOP::Response->new(
        exclusion => '',
        date      => '',
        unique_id => '',
    );

Return value

A new Webservice::GAMSTOP::Response object

get_exclusion

Exclusion flag provided in response headers

GAMSTOP Response:

- When GAMSTOP returns a Y response the user is registered with the GAMSTOP service with a valid current self-exclusion.

- When GAMSTOP returns an N response the user is not registered with the GAMSTOP service.

- When GAMSTOP returns a P response the user was previously self-excluded using the GAMSTOP service but their chosen minimum period of exclusion has lapsed and they have requested to have their self-exclusion removed

Return value

returns GAMSTOP exclusion flag or undef if not present

get_unique_id

Unique id provided in response headers

Return value

    returns GAMSTOP unique id for request or undef if not present

get_date

Date provided in response headers. Format: Tue, 27 Feb 2018 02:42:01 GMT

Return value

    returns GAMSTOP response date or undef if not present

is_excluded

Indicates whether user is self excluded or not

Return value

    True if user is excluded on GAMSTOP i.e GAMSTOP return a Y response else false

AUTHOR

binary.com <cpan@binary.com>

COPYRIGHT AND LICENSE

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.