NAME

WebService::Async::SmartyStreets::Address - object that contains the response from SmartyStreets API

SYNOPSIS

# Mocking a simple response from SmartyStreets API and parses it with WebService::Async::SmartyStreets::Address
my $response = WebService::Async::SmartyStreets::Address->new(
        metadata => {
        latitude => 101.2131,
        longitude => 180.1223,
        geocode_precision => "Premise",
    },
    analysis => {
        verification_status => "Partial",
        address_precision => "Premise",
    });
# Accessing the attributes
print ($response->status);

DESCRIPTION

Represents (parses) the return response from SmartyStreets API in an object

Construction

WebService::Async::SmartyStreets::Address->new(
    input_id => 12345,
    organization => 'Beenary',
    metadata => {
        latitude => 101.2131,
        longitude => 180.1223,
        geocode_precision => "Premise",
    },
    analysis => {
        verification_status => "Partial",
        address_precision => "Premise",
    });

METHODS - Accessors

input_id

organization

latitude

longitude

geocode_precision

max_geocode_precision

address_format

status

address_precision

max_address_precision

status_at_least

Checks if the returned response at least hits a certain level (in terms of score)

Example Usage:

$obj->status_at_least("partial");

Takes String which consists of verification status ("verified", "partial", "ambiguous", "none")

Returns 1 or 0

accuracy_at_least

Similar with status at least, checks if the returned response is at least hits a certain accuracy (in terms of score)

Example Usage:

$obj->accuracy_at_least("premise");

Takes String which consists of address accuracy ("none", "administrative_area", "locality", "thoroughfare", "premise", "delivery_point")

Returns 0 if the status is lower than 'partial'

Returns 1 or 0