Amazon-S3-Thin-ResponseParser

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

                die 'no such key';
            } else {
                warn $error->{code}, $error->{message};
            }
        }

    This takes an XML response as `$content` and it will return an error.
    The `$content` should be valid XML formed
    [Error Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html).

    `$error` is a hashref that looks like following form.

        {
            code       => 'NoSuchKey',
            message    => 'The resource you requested does not exist',
            resource   => '/mybucket/myfoto.jpg',
            request_id => '4442587FB7D0A2F9',
        };

- ($list\_objects, $error) = $response\_parser->list\_objects($content);

    This takes an XML response as `$content` and it will return a list of objects and an error if the `$content` has
    [Error Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html).
    The `$content` should be valid XML formed
    [GET Bucket (List Objects) Version 2](https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html) or
    [GET Bucket (List Objects) Version 1](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html).

    `$list_objects` is a hashref that looks like following form. undef is returned if there is the `$error`.

        {
            common_prefixes         => [],
            contents                => [
                {
                    etag          => 'fba9dede5f27731c9771645a39863328',
                    key           => 'my-image.jpg',
                    last_modified => '2009-10-12T17:50:30.000Z',
                    owner         => {
                        display_name => '',

README.md  view on Meta::CPAN

            # v1
            marker                  => '',
            next_marker             => '',
            # v2
            continuation_token      => '',
            next_continuation_token => '',
            key_count               => 205,
            start_after             => '',
        };

    `$error` is a hashref that looks like following form. undef is returned if there is the `$list_objects`.

        {
            code       => 'NoSuchKey',
            message    => 'The resource you requested does not exist',
            resource   => '/mybucket/myfoto.jpg',
            request_id => '4442587FB7D0A2F9',
        };

# SEE ALSO

lib/Amazon/S3/Thin/ResponseParser.pm  view on Meta::CPAN

            die 'no such key';
        } else {
            warn $error->{code}, $error->{message};
        }
    }

This takes an XML response as C<$content> and it will return an error.
The C<$content> should be valid XML formed
L<< Error Responses|https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html >>.

C<$error> is a hashref that looks like following form.

    {
        code       => 'NoSuchKey',
        message    => 'The resource you requested does not exist',
        resource   => '/mybucket/myfoto.jpg',
        request_id => '4442587FB7D0A2F9',
    };

=item ($list_objects, $error) = $response_parser->list_objects($content);

This takes an XML response as C<$content> and it will return a list of objects and an error if the C<$content> has
L<< Error Responses|https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html >>.
The C<$content> should be valid XML formed
L<< GET Bucket (List Objects) Version 2|https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html >> or
L<< GET Bucket (List Objects) Version 1|https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html >>.

C<$list_objects> is a hashref that looks like following form. undef is returned if there is the C<$error>.

    {
        common_prefixes         => [],
        contents                => [
            {
                etag          => 'fba9dede5f27731c9771645a39863328',
                key           => 'my-image.jpg',
                last_modified => '2009-10-12T17:50:30.000Z',
                owner         => {
                    display_name => '',

lib/Amazon/S3/Thin/ResponseParser.pm  view on Meta::CPAN

        # v1
        marker                  => '',
        next_marker             => '',
        # v2
        continuation_token      => '',
        next_continuation_token => '',
        key_count               => 205,
        start_after             => '',
    };

C<$error> is a hashref that looks like following form. undef is returned if there is the C<$list_objects>.

    {
        code       => 'NoSuchKey',
        message    => 'The resource you requested does not exist',
        resource   => '/mybucket/myfoto.jpg',
        request_id => '4442587FB7D0A2F9',
    };

=back



( run in 0.299 second using v1.01-cache-2.11-cpan-64827b87656 )