NAME

WWW::LogicBoxes::Customer - Representation of LogicBoxes Customer

SYNOPSIS

use strict;
use warnings;

use WWW::LogicBoxes::Customer;

my $customer = WWW::LogicBoxes::Customer->new(
    id       => 42,
    username => 'alan.turing@enigma-crackers.com',
    name     => 'Alan Turing',
    company  => 'Princeton University',
    address1 => 'Office P is Equal to NP',
    address2 => '123 Turing Machine Way',
    address3 => 'Suite 100',
    city     => 'New York',
    state    => 'New York',
    country  => 'US',
    zipcode  => '10108',
    phone_number        => '18005551212',
    alt_phone_number    => '18005551212',
    mobile_phone_number => '18005551212',
    fax_number          => '18005551212',
    language_preference => 'en',
);

DESCRIPTION

Representation of a LogicBoxes customer.

ATTRIBUTES

id

Customers that have been created with LogicBoxes will have an id assigned for them. A predicate exists 'has_id' that can be used to check to see if an id has been assigned to this customer. A private writer of _set_id is also provided.

username

Email address for customer.

name

company

Company of the customer. This is a required field so if there is no company some sentinal string of "None" or something similiar shou ld be used.

address1

address2

Predicate of has_address2.

address3

Predicate of has_address3.

city

state

This is the full name of the state, so Texas rather than TX should be used. Not all regions in the world have states so this is not a required field, a predicate of has_state exists.

country

The ISO-3166 code for the country. For more information on ISO-3166 please see Wikipedia.

zipcode

phone_number

Be sure to include the country code. When it comes to the phone number a string or Number::Phone object can be provided and it wi ll be coerced into the WWW::LogicBoxes::PhoneNumber internal representation used.

alt_phone_number

Predicate of has_alt_phone_number.

mobile_phone_number

Predicate of has_mobile_phone_number.

fax_number

Predicate of has_fax_number.

language_preference

The default language to use for messages that are displayed to customers if they log directly into LogicBoxes. This must be an ISO-639-1 two digit language code as detailed in https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. The default is en for English.

If you have fully abstracted LogicBoxes for your customers and they never log in directly to manage their domains then this value doesn't really matter.

METHODS

These methods are used internally, it's fairly unlikely that consumers will ever call them directly.

construct_from_response

my $logic_boxes = WWW::LogicBoxes->new( ... );

my $response = $logic_boxes->submit({
    method => 'customers__details_by_id',
    params => {
        'customer-id' => 42,
    }
});

my $customer = WWW::LogicBoxes::Customer->construct_from_response( $response );

Creates an instance of $self from a LogicBoxes response.