| 1 | package Amazon::SimpleDB::Domain; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 3 | ▶ | use Amazon::SimpleDB::Response; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | ▶ | use Carp qw( croak ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 9 | 0 | my $class = shift; | |||||||||||
| 10 | 0 | ▶ | my $args = shift || {}; | ||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 11 | 0 | my $self = bless $args, $class; | |||||||||||
| 12 | 0 | ▶ | croak "No account" unless $self->{account}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 13 | 0 | ▶ | croak "No (domain) name" unless $self->{name}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 0 | return $self; | |||||||||||
| 15 | } | ||||||||||||
| 16 | |||||||||||||
| 17 | 0 | ▶ | sub account { return $_[0]->{account} } | ||||||||||
|
Subroutine
account: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 18 | 0 | ▶ | sub name { return $_[0]->{name} } | ||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 19 | 0 | ▶ | sub delete { return $_[0]->{account}->delete_domain($_[0]->{name}) } | ||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 20 | |||||||||||||
| 21 | # note: limit can be between 1 and 250. default is 100. | ||||||||||||
| 22 | # note: cannot run longer then 5 seconds or times out. | ||||||||||||
| 23 | 0 | ▶ | sub query { | ||||||||||
|
Subroutine
query: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||
| 25 | 0 | ▶ | my $args = shift || {}; | ||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 26 | 0 | my $params = {DomainName => $self->{'name'}}; | |||||||||||
| 27 | 0 | ▶ | $params->{MaxNumberOfItems} = $args->{'limit'} if $args->{'limit'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 28 | 0 | ▶ | $params->{NextToken} = $args->{'next'} if $args->{'next'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 0 | ▶ | $params->{QueryExpression} = $args->{'query'} if $args->{'query'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | my $account = $self->{account}; | |||||||||||
| 31 | return | ||||||||||||
| 32 | Amazon::SimpleDB::Response->new( | ||||||||||||
| 33 | http_response => $account->request('Query', $params), | ||||||||||||
| 34 | domain => $self, | ||||||||||||
| 35 | account => $self->{account}, | ||||||||||||
| 36 | 0 | ); | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 3 | 1; | |||||||||||
| 40 | |||||||||||||
| 41 | __END__ | ||||||||||||