NAME

WWW::LogicBoxes::Role::Command - Basic Logic for Submission of Requests to LogicBoxes

SYNOPSIS

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Contact;

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

    my $response = $logic_boxes->submit({
        method => 'contacts__add',
        params => $contact->construct_creation_request(),
    });

WITH

WWW::LogicBoxes::Role::Command::Raw
WWW::LogicBoxes::Role::Command::Contact
WWW::LogicBoxes::Role::Command::Customer
WWW::LogicBoxes::Role::Command::Domain
WWW::LogicBoxes::Role::Command::Domain::Availability
WWW::LogicBoxes::Role::Command::Domain::PrivateNameServer
WWW::LogicBoxes::Role::Command::Domain::Registration

REQUIRES

response_type

DESCRIPTION

Primary interface to LogicBoxes API that is used by the rest of the WWW::LogicBoxes::Role::Command::* roles. The only reason a consumer would use the submit method directly would be if there was no corresponding Command for the needed operation.

METHODS

submit

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Contact;

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

    my $response = $logic_boxes->submit({
        method => 'contacts__add',
        params => $contact->construct_creation_request(),  # Optional for some methods
    });

The submit method is what sends requests over to LogicBoxes. It accepts a raw method and an optional HashRef of params (almost all methods require params to be provided, but not all do). For details on the structure of the params please see WWW::LogicBoxes::Role::Command::Raw.

The submit method returns a HashRef that represents the data returned by LogicBoxes. There is logic built into submit such that requests are always made with a JSON response which is what drives the creation of the HashRef form the response.