File Coverage

blib/lib/Paws/ResourceTagging.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Paws::ResourceTagging;
2 1     1   4459 use Moose;
  1         3  
  1         11  
3             sub service { 'tagging' }
4             sub version { '2017-01-26' }
5             sub target_prefix { 'ResourceGroupsTaggingAPI_20170126' }
6             sub json_version { "1.1" }
7             has max_attempts => (is => 'ro', isa => 'Int', default => 5);
8             has retry => (is => 'ro', isa => 'HashRef', default => sub {
9             { base => 'rand', type => 'exponential', growth_factor => 2 }
10             });
11             has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
12             ] });
13              
14             with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller', 'Paws::Net::JsonResponse';
15              
16            
17             sub GetResources {
18             my $self = shift;
19             my $call_object = $self->new_with_coercions('Paws::ResourceTagging::GetResources', @_);
20             return $self->caller->do_call($self, $call_object);
21             }
22             sub GetTagKeys {
23             my $self = shift;
24             my $call_object = $self->new_with_coercions('Paws::ResourceTagging::GetTagKeys', @_);
25             return $self->caller->do_call($self, $call_object);
26             }
27             sub GetTagValues {
28             my $self = shift;
29             my $call_object = $self->new_with_coercions('Paws::ResourceTagging::GetTagValues', @_);
30             return $self->caller->do_call($self, $call_object);
31             }
32             sub TagResources {
33             my $self = shift;
34             my $call_object = $self->new_with_coercions('Paws::ResourceTagging::TagResources', @_);
35             return $self->caller->do_call($self, $call_object);
36             }
37             sub UntagResources {
38             my $self = shift;
39             my $call_object = $self->new_with_coercions('Paws::ResourceTagging::UntagResources', @_);
40             return $self->caller->do_call($self, $call_object);
41             }
42            
43             sub GetAllResources {
44             my $self = shift;
45              
46             my $callback = shift @_ if (ref($_[0]) eq 'CODE');
47             my $result = $self->GetResources(@_);
48             my $next_result = $result;
49              
50             if (not defined $callback) {
51             while ($next_result->PaginationToken) {
52             $next_result = $self->GetResources(@_, PaginationToken => $next_result->PaginationToken);
53             push @{ $result->ResourceTagMappingList }, @{ $next_result->ResourceTagMappingList };
54             }
55             return $result;
56             } else {
57             while ($result->PaginationToken) {
58             $callback->($_ => 'ResourceTagMappingList') foreach (@{ $result->ResourceTagMappingList });
59             $result = $self->GetResources(@_, PaginationToken => $result->PaginationToken);
60             }
61             $callback->($_ => 'ResourceTagMappingList') foreach (@{ $result->ResourceTagMappingList });
62             }
63              
64             return undef
65             }
66             sub GetAllTagKeys {
67             my $self = shift;
68              
69             my $callback = shift @_ if (ref($_[0]) eq 'CODE');
70             my $result = $self->GetTagKeys(@_);
71             my $next_result = $result;
72              
73             if (not defined $callback) {
74             while ($next_result->PaginationToken) {
75             $next_result = $self->GetTagKeys(@_, PaginationToken => $next_result->PaginationToken);
76             push @{ $result->TagKeys }, @{ $next_result->TagKeys };
77             }
78             return $result;
79             } else {
80             while ($result->PaginationToken) {
81             $callback->($_ => 'TagKeys') foreach (@{ $result->TagKeys });
82             $result = $self->GetTagKeys(@_, PaginationToken => $result->PaginationToken);
83             }
84             $callback->($_ => 'TagKeys') foreach (@{ $result->TagKeys });
85             }
86              
87             return undef
88             }
89             sub GetAllTagValues {
90             my $self = shift;
91              
92             my $callback = shift @_ if (ref($_[0]) eq 'CODE');
93             my $result = $self->GetTagValues(@_);
94             my $next_result = $result;
95              
96             if (not defined $callback) {
97             while ($next_result->PaginationToken) {
98             $next_result = $self->GetTagValues(@_, PaginationToken => $next_result->PaginationToken);
99             push @{ $result->TagValues }, @{ $next_result->TagValues };
100             }
101             return $result;
102             } else {
103             while ($result->PaginationToken) {
104             $callback->($_ => 'TagValues') foreach (@{ $result->TagValues });
105             $result = $self->GetTagValues(@_, PaginationToken => $result->PaginationToken);
106             }
107             $callback->($_ => 'TagValues') foreach (@{ $result->TagValues });
108             }
109              
110             return undef
111             }
112              
113              
114             sub operations { qw/GetResources GetTagKeys GetTagValues TagResources UntagResources / }
115              
116             1;
117              
118             ### main pod documentation begin ###
119              
120             =head1 NAME
121              
122             Paws::ResourceTagging - Perl Interface to AWS AWS Resource Groups Tagging API
123              
124             =head1 SYNOPSIS
125              
126             use Paws;
127              
128             my $obj = Paws->service('ResourceTagging');
129             my $res = $obj->Method(
130             Arg1 => $val1,
131             Arg2 => [ 'V1', 'V2' ],
132             # if Arg3 is an object, the HashRef will be used as arguments to the constructor
133             # of the arguments type
134             Arg3 => { Att1 => 'Val1' },
135             # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
136             # the constructor of the arguments type
137             Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
138             );
139              
140             =head1 DESCRIPTION
141              
142             Resource Groups Tagging API
143              
144             This guide describes the API operations for the resource groups
145             tagging.
146              
147             A tag is a label that you assign to an AWS resource. A tag consists of
148             a key and a value, both of which you define. For example, if you have
149             two Amazon EC2 instances, you might assign both a tag key of "Stack."
150             But the value of "Stack" might be "Testing" for one and "Production"
151             for the other.
152              
153             Tagging can help you organize your resources and enables you to
154             simplify resource management, access management and cost allocation.
155             For more information about tagging, see Working with Tag Editor and
156             Working with Resource Groups. For more information about permissions
157             you need to use the resource groups tagging APIs, see Obtaining
158             Permissions for Resource Groups and Obtaining Permissions for Tagging .
159              
160             You can use the resource groups tagging APIs to complete the following
161             tasks:
162              
163             =over
164              
165             =item *
166              
167             Tag and untag supported resources located in the specified region for
168             the AWS account
169              
170             =item *
171              
172             Use tag-based filters to search for resources located in the specified
173             region for the AWS account
174              
175             =item *
176              
177             List all existing tag keys in the specified region for the AWS account
178              
179             =item *
180              
181             List all existing values for the specified key in the specified region
182             for the AWS account
183              
184             =back
185              
186             Not all resources can have tags. For a lists of resources that you can
187             tag, see Supported Resources in the I<AWS Resource Groups and Tag
188             Editor User Guide>.
189              
190             To make full use of the resource groups tagging APIs, you might need
191             additional IAM permissions, including permission to access the
192             resources of individual services as well as permission to view and
193             apply tags to those resources. For more information, see Obtaining
194             Permissions for Tagging in the I<AWS Resource Groups and Tag Editor
195             User Guide>.
196              
197             =head1 METHODS
198              
199             =head2 GetResources([PaginationToken => Str, ResourcesPerPage => Int, ResourceTypeFilters => ArrayRef[Str|Undef], TagFilters => ArrayRef[L<Paws::ResourceTagging::TagFilter>], TagsPerPage => Int])
200              
201             Each argument is described in detail in: L<Paws::ResourceTagging::GetResources>
202              
203             Returns: a L<Paws::ResourceTagging::GetResourcesOutput> instance
204              
205             Returns all the tagged resources that are associated with the specified
206             tags (keys and values) located in the specified region for the AWS
207             account. The tags and the resource types that you specify in the
208             request are known as I<filters>. The response includes all tags that
209             are associated with the requested resources. If no filter is provided,
210             this action returns a paginated resource list with the associated tags.
211              
212              
213             =head2 GetTagKeys([PaginationToken => Str])
214              
215             Each argument is described in detail in: L<Paws::ResourceTagging::GetTagKeys>
216              
217             Returns: a L<Paws::ResourceTagging::GetTagKeysOutput> instance
218              
219             Returns all tag keys in the specified region for the AWS account.
220              
221              
222             =head2 GetTagValues(Key => Str, [PaginationToken => Str])
223              
224             Each argument is described in detail in: L<Paws::ResourceTagging::GetTagValues>
225              
226             Returns: a L<Paws::ResourceTagging::GetTagValuesOutput> instance
227              
228             Returns all tag values for the specified key in the specified region
229             for the AWS account.
230              
231              
232             =head2 TagResources(ResourceARNList => ArrayRef[Str|Undef], Tags => L<Paws::ResourceTagging::TagMap>)
233              
234             Each argument is described in detail in: L<Paws::ResourceTagging::TagResources>
235              
236             Returns: a L<Paws::ResourceTagging::TagResourcesOutput> instance
237              
238             Applies one or more tags to the specified resources. Note the
239             following:
240              
241             =over
242              
243             =item *
244              
245             Not all resources can have tags. For a list of resources that support
246             tagging, see Supported Resources in the I<AWS Resource Groups and Tag
247             Editor User Guide>.
248              
249             =item *
250              
251             Each resource can have up to 50 tags. For other limits, see Tag
252             Restrictions in the I<Amazon EC2 User Guide for Linux Instances>.
253              
254             =item *
255              
256             You can only tag resources that are located in the specified region for
257             the AWS account.
258              
259             =item *
260              
261             To add tags to a resource, you need the necessary permissions for the
262             service that the resource belongs to as well as permissions for adding
263             tags. For more information, see Obtaining Permissions for Tagging in
264             the I<AWS Resource Groups and Tag Editor User Guide>.
265              
266             =back
267              
268              
269              
270             =head2 UntagResources(ResourceARNList => ArrayRef[Str|Undef], TagKeys => ArrayRef[Str|Undef])
271              
272             Each argument is described in detail in: L<Paws::ResourceTagging::UntagResources>
273              
274             Returns: a L<Paws::ResourceTagging::UntagResourcesOutput> instance
275              
276             Removes the specified tags from the specified resources. When you
277             specify a tag key, the action removes both that key and its associated
278             value. The operation succeeds even if you attempt to remove tags from a
279             resource that were already removed. Note the following:
280              
281             =over
282              
283             =item *
284              
285             To remove tags from a resource, you need the necessary permissions for
286             the service that the resource belongs to as well as permissions for
287             removing tags. For more information, see Obtaining Permissions for
288             Tagging in the I<AWS Resource Groups and Tag Editor User Guide>.
289              
290             =item *
291              
292             You can only tag resources that are located in the specified region for
293             the AWS account.
294              
295             =back
296              
297              
298              
299              
300              
301             =head1 PAGINATORS
302              
303             Paginator methods are helpers that repetively call methods that return partial results
304              
305             =head2 GetAllResources(sub { },[PaginationToken => Str, ResourcesPerPage => Int, ResourceTypeFilters => ArrayRef[Str|Undef], TagFilters => ArrayRef[L<Paws::ResourceTagging::TagFilter>], TagsPerPage => Int])
306              
307             =head2 GetAllResources([PaginationToken => Str, ResourcesPerPage => Int, ResourceTypeFilters => ArrayRef[Str|Undef], TagFilters => ArrayRef[L<Paws::ResourceTagging::TagFilter>], TagsPerPage => Int])
308              
309              
310             If passed a sub as first parameter, it will call the sub for each element found in :
311              
312             - ResourceTagMappingList, passing the object as the first parameter, and the string 'ResourceTagMappingList' as the second parameter
313              
314             If not, it will return a a L<Paws::ResourceTagging::GetResourcesOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
315              
316              
317             =head2 GetAllTagKeys(sub { },[PaginationToken => Str])
318              
319             =head2 GetAllTagKeys([PaginationToken => Str])
320              
321              
322             If passed a sub as first parameter, it will call the sub for each element found in :
323              
324             - TagKeys, passing the object as the first parameter, and the string 'TagKeys' as the second parameter
325              
326             If not, it will return a a L<Paws::ResourceTagging::GetTagKeysOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
327              
328              
329             =head2 GetAllTagValues(sub { },Key => Str, [PaginationToken => Str])
330              
331             =head2 GetAllTagValues(Key => Str, [PaginationToken => Str])
332              
333              
334             If passed a sub as first parameter, it will call the sub for each element found in :
335              
336             - TagValues, passing the object as the first parameter, and the string 'TagValues' as the second parameter
337              
338             If not, it will return a a L<Paws::ResourceTagging::GetTagValuesOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
339              
340              
341              
342              
343              
344             =head1 SEE ALSO
345              
346             This service class forms part of L<Paws>
347              
348             =head1 BUGS and CONTRIBUTIONS
349              
350             The source code is located here: https://github.com/pplu/aws-sdk-perl
351              
352             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
353              
354             =cut
355