lib/Amazon/SQS/Model/CreateQueueRequest.pm untested

filter: Statementstmt 0.0% 0 / 40 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 71 CC 3 SCAR 11.0
CC
3
Cov
0%
new
6.0
setAttribute
6.0
getQueueName
2.0
CRAP 3.0
1 ################################################################################
2 # Copyright 2008 Amazon Technologies, Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 #
5 # You may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
7 # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
8 # CONDITIONS OF ANY KIND, either express or implied. See the License for the
9 # specific language governing permissions and limitations under the License.
10 ################################################################################
11 # __ _ _ ___
12 # ( )( \/\/ )/ __)
13 # /__\ \ / \__ \
14 # (_)(_) \/\/ (___/
15 #
16 # Amazon SQS Perl Library
17 # API Version: 2009-02-01
18 # Generated: Thu Apr 09 01:13:11 PDT 2009
19 #
20  
21  
22 package Amazon::SQS::Model::CreateQueueRequest;
23  
24 use base qw (Amazon::SQS::Model);
25  
26 =pod
27  
28 =head1 NAME
29  
30 Amazon::SQS::Model::CreateQueueRequest
31  
32 =head1 SYNOPSIS
33  
34 my $request = new Amazon::SQS::Model::CreateQueueRequest(
35 {
36 QueueName => $queue_name,
37 DefaultVisibilityTime => $timeout
38 }
39 );
40  
41 $service->createQueue( $request );
42  
43 =head1 DESCRIPTION
44  
45 Implements a class that represents a request used to create a new SQS
46 queue.
47  
48 =head1 METHODS
49  
50 =head2 new
51  
52 new( options )
53  
54 =over 5
55  
56 =item options
57  
58 Hash reference containing the options listed below.
59  
60 =over 5
61  
62 =item QueueName
63  
64 The name of the queue that you created.
65  
66 =item DefaultVisibilityTimeout
67  
68 The amount of time (in seconds) that a message received from a queue
69 will be I<invisible> to other receiving components when they ask to
70 receive messages.
71  
72 =item Attribute
73  
74 C<Amazon::SQS::Model::Attribute>
75  
76 =back
77  
78 =back
79  
80 =cut
81
82  
83 sub new {
84 my ($class, $data) = @_;
85 my $self = {};
86 $self->{_fields} = {
87 QueueName => { FieldValue => undef, FieldType => "string"},
88 DefaultVisibilityTimeout => { FieldValue => undef, FieldType => "int"},
89 Attribute => {FieldValue => [], FieldType => ["Amazon::SQS::Model::Attribute"]},
90 };
91  
92 bless ($self, $class);
93 if (defined $data) {
94 $self->_fromHashRef($data);
95 }
96
97 return $self;
98 }
99  
100
101 sub getQueueName {
102 return shift->{_fields}->{QueueName}->{FieldValue};
103 }
104  
105  
106 sub setQueueName {
107 my ($self, $value) = @_;
108  
109 $self->{_fields}->{QueueName}->{FieldValue} = $value;
110 return $self;
111 }
112  
113  
114 sub withQueueName {
115 my ($self, $value) = @_;
116 $self->setQueueName($value);
117 return $self;
118 }
119  
120  
121 sub isSetQueueName {
122 return defined (shift->{_fields}->{QueueName}->{FieldValue});
123 }
124  
125  
126 sub getDefaultVisibilityTimeout {
127 return shift->{_fields}->{DefaultVisibilityTimeout}->{FieldValue};
128 }
129  
130  
131 sub setDefaultVisibilityTimeout {
132 my ($self, $value) = @_;
133  
134 $self->{_fields}->{DefaultVisibilityTimeout}->{FieldValue} = $value;
135 return $self;
136 }
137  
138  
139 sub withDefaultVisibilityTimeout {
140 my ($self, $value) = @_;
141 $self->setDefaultVisibilityTimeout($value);
142 return $self;
143 }
144  
145  
146 sub isSetDefaultVisibilityTimeout {
147 return defined (shift->{_fields}->{DefaultVisibilityTimeout}->{FieldValue});
148 }
149  
150 sub getAttribute {
151 return shift->{_fields}->{Attribute}->{FieldValue};
152 }
153  
154 sub setAttribute {
155 my $self = shift;
156 foreach my $attribute (@_) {
157 if (not $self->_isArrayRef($attribute)) {
158 $attribute = [$attribute];
159 }
160 $self->{_fields}->{Attribute}->{FieldValue} = $attribute;
161 }
162 }
163  
164  
165 sub withAttribute {
166 my ($self, $attributeArgs) = @_;
167 foreach my $attribute (@$attributeArgs) {
168 $self->{_fields}->{Attribute}->{FieldValue} = $attribute;
169 }
170 return $self;
171 }
172  
173  
174 sub isSetAttribute {
175 return scalar (@{shift->{_fields}->{Attribute}->{FieldValue}}) > 0;
176 }
177
178  
179 =pod
180  
181 =head1 SEE ALSO
182  
183 C<Amazon::SQS::Client>
184  
185 =head1 AUTHOR
186  
187 Elena@AWS
188  
189 =cut
190  
191 1;