Amazon::SimpleDB::ListDomainsResponse - a class


Amazon-SimpleDB documentation Contained in the Amazon-SimpleDB distribution.

Index


Code Index:

NAME

Top

Amazon::SimpleDB::ListDomainsResponse - a class representing the response to a successful ListDomains request.

DESCRIPTION

Top

This is code is in the early stages of development. Do not consider it stable. Feedback and patches welcome.

This is a subclass Amazon::SimpleDB::Response. See its manpage for more.

METHODS

Top

Amazon::SimpleDB::ListDomainsResponse->new($args)

Constructor. It is recommended that you use Amazon::SimpleDB::Response-new($http_response)> instead of calling this directly. It will determine if this specialized response class is appropriate and will call this constructor for you.

$res->results

Returns an ARRAY of Amazon::SimpleDB::Domain objects for the account.

$res->next

Returns a string representing the NextToken value returned from the service. Returned undefined if nothing was returned.

SEE ALSO

Top

Amazon::SimpleDB::Response

AUTHOR & COPYRIGHT

Top


Amazon-SimpleDB documentation Contained in the Amazon-SimpleDB distribution.

package Amazon::SimpleDB::ListDomainsResponse;
use strict;
use warnings;

use base 'Amazon::SimpleDB::Response';

use Amazon::SimpleDB::Domain;

sub results {
    my $self    = shift;
    my $results =
      $self->{content}->{ListDomainsResponse}{ListDomainsResult}{DomainName};
    $self->{next} =
      $self->{content}->{ListDomainsResponse}{ListDomainsResult}{NextToken};
    my @domains = map {
        Amazon::SimpleDB::Domain->new({name => $_, account => $self->{account}})
    } @$results;
    return wantarray ? @domains : $domains[0];
}

sub next { return $_[0]->{next} }

1;

__END__