Amazon::SimpleDB::GetAttributesResponse - a class


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

Index


Code Index:

NAME

Top

Amazon::SimpleDB::GetAttributesResponse - a class representing the response to a successful GetAttributes 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::GetAttributesResponse->new($args)

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

$res->results

Returns a HASHREF of the attributes of an item as requested. An attribute name is the HASH key. All attribute values are ARRAYREFs regardless of value count.

SEE ALSO

Top

Amazon::SimpleDB::Response

AUTHOR & COPYRIGHT

Top


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

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

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

sub results {
    my $self    = shift;
    my $results =
      $self->{content}->{GetAttributesResponse}{GetAttributesResult}{Attribute};
    my $attr = {};
    for my $a (@$results) {
        $attr->{$a->{'Name'}} ||= [];
        push @{$attr->{$a->{'Name'}}}, $a->{'Value'};
    }
    return $attr;
}

1;

__END__