« lib/Amazon/SQS/Model/SendMessageRequest.pm
↑ Summary
lib/Amazon/SQS/Model/ReceiveMessageResponse.pm »
| 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 | package Amazon::SQS::Model::MessageAttribute; | ||
| 22 | |||
| 23 | use base qw (Amazon::SQS::Model); | ||
| 24 | |||
| 25 | use Scalar::Util qw/reftype/; | ||
| 26 | use Data::Dumper; | ||
| 27 | |||
| 28 | =pod | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Amazon::SQS::Model::Attribute | ||
| 33 | |||
| 34 | =head1 SYNOPSIS | ||
| 35 | |||
| 36 | my $attribute = new Amazon::SQS::Model::Attribute( | ||
| 37 | { | ||
| 38 | Name => 'VisibilityTimeout', | ||
| 39 | Value => '60' | ||
| 40 | } | ||
| 41 | ); | ||
| 42 | |||
| 43 | =head1 DESCRIPTION | ||
| 44 | |||
| 45 | Create an attribute object for use with various SQS API requests. | ||
| 46 | |||
| 47 | =head1 METHODS | ||
| 48 | |||
| 49 | =head2 new | ||
| 50 | |||
| 51 | new( options ) | ||
| 52 | |||
| 53 | C<options> is a hash reference that contains the attribute name and value. | ||
| 54 | |||
| 55 | =over 5 | ||
| 56 | |||
| 57 | =item Name | ||
| 58 | |||
| 59 | =item Value | ||
| 60 | |||
| 61 | =item Type | ||
| 62 | |||
| 63 | =back | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | sub new { | ||
| 68 | my ($class, $data) = @_; | ||
| 69 | my $self = {}; | ||
| 70 | $self->{_fields} = { | ||
| 71 | Name => { FieldValue => undef, FieldType => "string"}, | ||
| 72 | Value => { FieldValue => undef, FieldType => "Amazon::SQS::Model::MessageAttributeValue"} | ||
| 73 | }; | ||
| 74 | |||
| 75 | bless ($self, $class); | ||
| 76 | if (defined $data) { | ||
| 77 | $self->_fromHashRef($data); | ||
| 78 | } | ||
| 79 | |||
| 80 | return $self; | ||
| 81 | } | ||
| 82 | |||
| 83 | |||
| 84 | sub getName { | ||
| 85 | return shift->{_fields}->{Name}->{FieldValue}; | ||
| 86 | } | ||
| 87 | |||
| 88 | |||
| 89 | sub setName { | ||
| 90 | my ($self, $value) = @_; | ||
| 91 | |||
| 92 | $self->{_fields}->{Name}->{FieldValue} = $value; | ||
| 93 | return $self; | ||
| 94 | } | ||
| 95 | |||
| 96 | |||
| 97 | sub withName { | ||
| 98 | my ($self, $value) = @_; | ||
| 99 | $self->setName($value); | ||
| 100 | return $self; | ||
| 101 | } | ||
| 102 | |||
| 103 | |||
| 104 | sub isSetName { | ||
| 105 | return defined (shift->{_fields}->{Name}->{FieldValue}); | ||
| 106 | } | ||
| 107 | |||
| 108 | sub getDataType { | ||
| 109 | return shift->{_fields}->{DataType}->{FieldValue}; | ||
| 110 | } | ||
| 111 | |||
| 112 | sub setDataType { | ||
| 113 | my ($self, $value) = @_; | ||
| 114 | |||
| 115 | $self->{_fields}->{DataType}->{FieldValue} = $value; | ||
| 116 | return $self; | ||
| 117 | } | ||
| 118 | |||
| 119 | sub withDataType { | ||
| 120 | my ($self, $value) = @_; | ||
| 121 | $self->setDataType($value); | ||
| 122 | return $self; | ||
| 123 | } | ||
| 124 | |||
| 125 | |||
| 126 | sub isSetDataType { | ||
| 127 | return defined (shift->{_fields}->{DataType}->{FieldValue}); | ||
| 128 | } | ||
| 129 | |||
| 130 | |||
| 131 | sub getValue { | ||
| 132 | return shift->{_fields}->{Value}->{FieldValue}; | ||
| 133 | } | ||
| 134 | |||
| 135 | |||
| 136 | sub setValue { | ||
| 137 | my ($self, $value) = @_; | ||
| 138 | |||
| 139 | $self->{_fields}->{Value}->{FieldValue} = $value; | ||
| 140 | return $self; | ||
| 141 | } | ||
| 142 | |||
| 143 | |||
| 144 | sub withValue { | ||
| 145 | my ($self, $value) = @_; | ||
| 146 | $self->setValue($value); | ||
| 147 | return $self; | ||
| 148 | } | ||
| 149 | |||
| 150 | |||
| 151 | sub isSetValue { | ||
| 152 | return defined (shift->{_fields}->{Value}->{FieldValue}); | ||
| 153 | } | ||
| 154 | |||
| 155 | |||
| 156 | =pod | ||
| 157 | |||
| 158 | =head1 SEE OTHER | ||
| 159 | |||
| 160 | C<Amazon::SQS::Client> | ||
| 161 | |||
| 162 | =head1 AUTHOR | ||
| 163 | |||
| 164 | Elena@AWS | ||
| 165 | |||
| 166 | =cut | ||
| 167 | |||
| 168 | |||
| 169 | 1; |