aws-sdk-iam 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,14 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module IAM
10
- module Errors
8
+ module Aws::IAM
9
+ module Errors
11
10
 
12
- extend Aws::Errors::DynamicErrors
11
+ extend Aws::Errors::DynamicErrors
13
12
 
14
- # Raised when calling #load or #data on a resource class that can not be
15
- # loaded. This can happen when:
16
- #
17
- # * A resource class has identifiers, but no data attributes.
18
- # * Resource data is only available when making an API call that
19
- # enumerates all resources of that type.
20
- class ResourceNotLoadable < RuntimeError; end
21
- end
22
13
  end
23
14
  end
@@ -1,459 +1,463 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module IAM
10
- class Group
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(name, options = {})
15
- # @param [String] name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @name = extract_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::IAM
9
+ class Group
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(name, options = {})
14
+ # @param [String] name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @name = extract_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def name
31
- @name
32
- end
33
- alias :group_name :name
34
-
35
- # The path to the group. For more information about paths, see [IAM
36
- # Identifiers][1] in the *Using IAM* guide.
37
- #
38
- #
39
- #
40
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
41
- # @return [String]
42
- def path
43
- data.path
44
- end
28
+ # @return [String]
29
+ def name
30
+ @name
31
+ end
32
+ alias :group_name :name
33
+
34
+ # The path to the group. For more information about paths, see [IAM
35
+ # Identifiers][1] in the *Using IAM* guide.
36
+ #
37
+ #
38
+ #
39
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
40
+ # @return [String]
41
+ def path
42
+ data.path
43
+ end
45
44
 
46
- # The stable and unique string identifying the group. For more
47
- # information about IDs, see [IAM Identifiers][1] in the *Using IAM*
48
- # guide.
49
- #
50
- #
51
- #
52
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
53
- # @return [String]
54
- def group_id
55
- data.group_id
56
- end
45
+ # The stable and unique string identifying the group. For more
46
+ # information about IDs, see [IAM Identifiers][1] in the *Using IAM*
47
+ # guide.
48
+ #
49
+ #
50
+ #
51
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
52
+ # @return [String]
53
+ def group_id
54
+ data.group_id
55
+ end
57
56
 
58
- # The Amazon Resource Name (ARN) specifying the group. For more
59
- # information about ARNs and how to use them in policies, see [IAM
60
- # Identifiers][1] in the *Using IAM* guide.
61
- #
62
- #
63
- #
64
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
65
- # @return [String]
66
- def arn
67
- data.arn
68
- end
57
+ # The Amazon Resource Name (ARN) specifying the group. For more
58
+ # information about ARNs and how to use them in policies, see [IAM
59
+ # Identifiers][1] in the *Using IAM* guide.
60
+ #
61
+ #
62
+ #
63
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
64
+ # @return [String]
65
+ def arn
66
+ data.arn
67
+ end
69
68
 
70
- # The date and time, in [ISO 8601 date-time format][1], when the group
71
- # was created.
72
- #
73
- #
74
- #
75
- # [1]: http://www.iso.org/iso/iso8601
76
- # @return [Time]
77
- def create_date
78
- data.create_date
79
- end
69
+ # The date and time, in [ISO 8601 date-time format][1], when the group
70
+ # was created.
71
+ #
72
+ #
73
+ #
74
+ # [1]: http://www.iso.org/iso/iso8601
75
+ # @return [Time]
76
+ def create_date
77
+ data.create_date
78
+ end
80
79
 
81
- # @!endgroup
80
+ # @!endgroup
82
81
 
83
- # @return [Client]
84
- def client
85
- @client
86
- end
82
+ # @return [Client]
83
+ def client
84
+ @client
85
+ end
87
86
 
88
- # Loads, or reloads {#data} for the current {Group}.
89
- # Returns `self` making it possible to chain methods.
90
- #
91
- # group.reload.data
92
- #
93
- # @return [self]
94
- def load
95
- resp = @client.get_group(group_name: @name)
96
- @data = resp.group
97
- self
98
- end
99
- alias :reload :load
100
-
101
- # @return [Types::Group]
102
- # Returns the data for this {Group}. Calls
103
- # {Client#get_group} if {#data_loaded?} is `false`.
104
- def data
105
- load unless @data
106
- @data
107
- end
87
+ # Loads, or reloads {#data} for the current {Group}.
88
+ # Returns `self` making it possible to chain methods.
89
+ #
90
+ # group.reload.data
91
+ #
92
+ # @return [self]
93
+ def load
94
+ resp = @client.get_group(group_name: @name)
95
+ @data = resp.group
96
+ self
97
+ end
98
+ alias :reload :load
99
+
100
+ # @return [Types::Group]
101
+ # Returns the data for this {Group}. Calls
102
+ # {Client#get_group} if {#data_loaded?} is `false`.
103
+ def data
104
+ load unless @data
105
+ @data
106
+ end
108
107
 
109
- # @return [Boolean]
110
- # Returns `true` if this resource is loaded. Accessing attributes or
111
- # {#data} on an unloaded resource will trigger a call to {#load}.
112
- def data_loaded?
113
- !!@data
114
- end
108
+ # @return [Boolean]
109
+ # Returns `true` if this resource is loaded. Accessing attributes or
110
+ # {#data} on an unloaded resource will trigger a call to {#load}.
111
+ def data_loaded?
112
+ !!@data
113
+ end
115
114
 
116
- # @!group Actions
117
-
118
- # @example Request syntax with placeholder values
119
- #
120
- # group.add_user({
121
- # user_name: "existingUserNameType", # required
122
- # })
123
- # @param [Hash] options ({})
124
- # @option options [required, String] :user_name
125
- # The name of the user to add.
126
- #
127
- # The [regex pattern][1] for this parameter is a string of characters
128
- # consisting of upper and lowercase alphanumeric characters with no
129
- # spaces. You can also include any of the following characters: =,.@-
130
- #
131
- #
132
- #
133
- # [1]: http://wikipedia.org/wiki/regex
134
- # @return [EmptyStructure]
135
- def add_user(options = {})
136
- options = options.merge(group_name: @name)
137
- resp = @client.add_user_to_group(options)
138
- resp.data
139
- end
115
+ # @!group Actions
116
+
117
+ # @example Request syntax with placeholder values
118
+ #
119
+ # group.add_user({
120
+ # user_name: "existingUserNameType", # required
121
+ # })
122
+ # @param [Hash] options ({})
123
+ # @option options [required, String] :user_name
124
+ # The name of the user to add.
125
+ #
126
+ # This parameter allows (per its [regex pattern][1]) a string of
127
+ # characters consisting of upper and lowercase alphanumeric characters
128
+ # with no spaces. You can also include any of the following characters:
129
+ # =,.@-
130
+ #
131
+ #
132
+ #
133
+ # [1]: http://wikipedia.org/wiki/regex
134
+ # @return [EmptyStructure]
135
+ def add_user(options = {})
136
+ options = options.merge(group_name: @name)
137
+ resp = @client.add_user_to_group(options)
138
+ resp.data
139
+ end
140
140
 
141
- # @example Request syntax with placeholder values
142
- #
143
- # group.attach_policy({
144
- # policy_arn: "arnType", # required
145
- # })
146
- # @param [Hash] options ({})
147
- # @option options [required, String] :policy_arn
148
- # The Amazon Resource Name (ARN) of the IAM policy you want to attach.
149
- #
150
- # For more information about ARNs, see [Amazon Resource Names (ARNs) and
151
- # AWS Service Namespaces][1] in the *AWS General Reference*.
152
- #
153
- #
154
- #
155
- # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
156
- # @return [EmptyStructure]
157
- def attach_policy(options = {})
158
- options = options.merge(group_name: @name)
159
- resp = @client.attach_group_policy(options)
160
- resp.data
161
- end
141
+ # @example Request syntax with placeholder values
142
+ #
143
+ # group.attach_policy({
144
+ # policy_arn: "arnType", # required
145
+ # })
146
+ # @param [Hash] options ({})
147
+ # @option options [required, String] :policy_arn
148
+ # The Amazon Resource Name (ARN) of the IAM policy you want to attach.
149
+ #
150
+ # For more information about ARNs, see [Amazon Resource Names (ARNs) and
151
+ # AWS Service Namespaces][1] in the *AWS General Reference*.
152
+ #
153
+ #
154
+ #
155
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
156
+ # @return [EmptyStructure]
157
+ def attach_policy(options = {})
158
+ options = options.merge(group_name: @name)
159
+ resp = @client.attach_group_policy(options)
160
+ resp.data
161
+ end
162
162
 
163
- # @example Request syntax with placeholder values
164
- #
165
- # group = group.create({
166
- # path: "pathType",
167
- # })
168
- # @param [Hash] options ({})
169
- # @option options [String] :path
170
- # The path to the group. For more information about paths, see [IAM
171
- # Identifiers][1] in the *IAM User Guide*.
172
- #
173
- # This parameter is optional. If it is not included, it defaults to a
174
- # slash (/).
175
- #
176
- # The [regex pattern][2] for this parameter is a string of characters
177
- # consisting of either a forward slash (/) by itself or a string that
178
- # must begin and end with forward slashes, containing any ASCII
179
- # character from the ! (\\u0021) thru the DEL character (\\u007F),
180
- # including most punctuation characters, digits, and upper and
181
- # lowercased letters.
182
- #
183
- #
184
- #
185
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
186
- # [2]: http://wikipedia.org/wiki/regex
187
- # @return [Group]
188
- def create(options = {})
189
- options = options.merge(group_name: @name)
190
- resp = @client.create_group(options)
191
- Group.new(
192
- name: options[:group_name],
193
- data: resp.data.group,
194
- client: @client
195
- )
196
- end
163
+ # @example Request syntax with placeholder values
164
+ #
165
+ # group = group.create({
166
+ # path: "pathType",
167
+ # })
168
+ # @param [Hash] options ({})
169
+ # @option options [String] :path
170
+ # The path to the group. For more information about paths, see [IAM
171
+ # Identifiers][1] in the *IAM User Guide*.
172
+ #
173
+ # This parameter is optional. If it is not included, it defaults to a
174
+ # slash (/).
175
+ #
176
+ # This paramater allows (per its [regex pattern][2]) a string of
177
+ # characters consisting of either a forward slash (/) by itself or a
178
+ # string that must begin and end with forward slashes, containing any
179
+ # ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
180
+ # including most punctuation characters, digits, and upper and
181
+ # lowercased letters.
182
+ #
183
+ #
184
+ #
185
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
186
+ # [2]: http://wikipedia.org/wiki/regex
187
+ # @return [Group]
188
+ def create(options = {})
189
+ options = options.merge(group_name: @name)
190
+ resp = @client.create_group(options)
191
+ Group.new(
192
+ name: options[:group_name],
193
+ data: resp.data.group,
194
+ client: @client
195
+ )
196
+ end
197
197
 
198
- # @example Request syntax with placeholder values
199
- #
200
- # grouppolicy = group.create_policy({
201
- # policy_name: "policyNameType", # required
202
- # policy_document: "policyDocumentType", # required
203
- # })
204
- # @param [Hash] options ({})
205
- # @option options [required, String] :policy_name
206
- # The name of the policy document.
207
- #
208
- # The [regex pattern][1] for this parameter is a string of characters
209
- # consisting of upper and lowercase alphanumeric characters with no
210
- # spaces. You can also include any of the following characters: =,.@-
211
- #
212
- #
213
- #
214
- # [1]: http://wikipedia.org/wiki/regex
215
- # @option options [required, String] :policy_document
216
- # The policy document.
217
- #
218
- # The [regex pattern][1] for this parameter is a string of characters
219
- # consisting of any printable ASCII character ranging from the space
220
- # character (\\u0020) through end of the ASCII character range
221
- # (\\u00FF). It also includes the special characters tab (\\u0009), line
222
- # feed (\\u000A), and carriage return (\\u000D).
223
- #
224
- #
225
- #
226
- # [1]: http://wikipedia.org/wiki/regex
227
- # @return [GroupPolicy]
228
- def create_policy(options = {})
229
- options = options.merge(group_name: @name)
230
- resp = @client.put_group_policy(options)
231
- GroupPolicy.new(
232
- group_name: @name,
233
- name: options[:policy_name],
234
- client: @client
235
- )
236
- end
198
+ # @example Request syntax with placeholder values
199
+ #
200
+ # grouppolicy = group.create_policy({
201
+ # policy_name: "policyNameType", # required
202
+ # policy_document: "policyDocumentType", # required
203
+ # })
204
+ # @param [Hash] options ({})
205
+ # @option options [required, String] :policy_name
206
+ # The name of the policy document.
207
+ #
208
+ # This parameter allows (per its [regex pattern][1]) a string of
209
+ # characters consisting of upper and lowercase alphanumeric characters
210
+ # with no spaces. You can also include any of the following characters:
211
+ # =,.@-
212
+ #
213
+ #
214
+ #
215
+ # [1]: http://wikipedia.org/wiki/regex
216
+ # @option options [required, String] :policy_document
217
+ # The policy document.
218
+ #
219
+ # The [regex pattern][1] used to validate this parameter is a string of
220
+ # characters consisting of any printable ASCII character ranging from
221
+ # the space character (\\u0020) through end of the ASCII character range
222
+ # as well as the printable characters in the Basic Latin and Latin-1
223
+ # Supplement character set (through \\u00FF). It also includes the
224
+ # special characters tab (\\u0009), line feed (\\u000A), and carriage
225
+ # return (\\u000D).
226
+ #
227
+ #
228
+ #
229
+ # [1]: http://wikipedia.org/wiki/regex
230
+ # @return [GroupPolicy]
231
+ def create_policy(options = {})
232
+ options = options.merge(group_name: @name)
233
+ resp = @client.put_group_policy(options)
234
+ GroupPolicy.new(
235
+ group_name: @name,
236
+ name: options[:policy_name],
237
+ client: @client
238
+ )
239
+ end
237
240
 
238
- # @example Request syntax with placeholder values
239
- #
240
- # group.delete()
241
- # @param [Hash] options ({})
242
- # @return [EmptyStructure]
243
- def delete(options = {})
244
- options = options.merge(group_name: @name)
245
- resp = @client.delete_group(options)
246
- resp.data
247
- end
241
+ # @example Request syntax with placeholder values
242
+ #
243
+ # group.delete()
244
+ # @param [Hash] options ({})
245
+ # @return [EmptyStructure]
246
+ def delete(options = {})
247
+ options = options.merge(group_name: @name)
248
+ resp = @client.delete_group(options)
249
+ resp.data
250
+ end
248
251
 
249
- # @example Request syntax with placeholder values
250
- #
251
- # group.detach_policy({
252
- # policy_arn: "arnType", # required
253
- # })
254
- # @param [Hash] options ({})
255
- # @option options [required, String] :policy_arn
256
- # The Amazon Resource Name (ARN) of the IAM policy you want to detach.
257
- #
258
- # For more information about ARNs, see [Amazon Resource Names (ARNs) and
259
- # AWS Service Namespaces][1] in the *AWS General Reference*.
260
- #
261
- #
262
- #
263
- # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
264
- # @return [EmptyStructure]
265
- def detach_policy(options = {})
266
- options = options.merge(group_name: @name)
267
- resp = @client.detach_group_policy(options)
268
- resp.data
269
- end
252
+ # @example Request syntax with placeholder values
253
+ #
254
+ # group.detach_policy({
255
+ # policy_arn: "arnType", # required
256
+ # })
257
+ # @param [Hash] options ({})
258
+ # @option options [required, String] :policy_arn
259
+ # The Amazon Resource Name (ARN) of the IAM policy you want to detach.
260
+ #
261
+ # For more information about ARNs, see [Amazon Resource Names (ARNs) and
262
+ # AWS Service Namespaces][1] in the *AWS General Reference*.
263
+ #
264
+ #
265
+ #
266
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
267
+ # @return [EmptyStructure]
268
+ def detach_policy(options = {})
269
+ options = options.merge(group_name: @name)
270
+ resp = @client.detach_group_policy(options)
271
+ resp.data
272
+ end
270
273
 
271
- # @example Request syntax with placeholder values
272
- #
273
- # group.remove_user({
274
- # user_name: "existingUserNameType", # required
275
- # })
276
- # @param [Hash] options ({})
277
- # @option options [required, String] :user_name
278
- # The name of the user to remove.
279
- #
280
- # The [regex pattern][1] for this parameter is a string of characters
281
- # consisting of upper and lowercase alphanumeric characters with no
282
- # spaces. You can also include any of the following characters: =,.@-
283
- #
284
- #
285
- #
286
- # [1]: http://wikipedia.org/wiki/regex
287
- # @return [EmptyStructure]
288
- def remove_user(options = {})
289
- options = options.merge(group_name: @name)
290
- resp = @client.remove_user_from_group(options)
291
- resp.data
292
- end
274
+ # @example Request syntax with placeholder values
275
+ #
276
+ # group.remove_user({
277
+ # user_name: "existingUserNameType", # required
278
+ # })
279
+ # @param [Hash] options ({})
280
+ # @option options [required, String] :user_name
281
+ # The name of the user to remove.
282
+ #
283
+ # This parameter allows (per its [regex pattern][1]) a string of
284
+ # characters consisting of upper and lowercase alphanumeric characters
285
+ # with no spaces. You can also include any of the following characters:
286
+ # =,.@-
287
+ #
288
+ #
289
+ #
290
+ # [1]: http://wikipedia.org/wiki/regex
291
+ # @return [EmptyStructure]
292
+ def remove_user(options = {})
293
+ options = options.merge(group_name: @name)
294
+ resp = @client.remove_user_from_group(options)
295
+ resp.data
296
+ end
293
297
 
294
- # @example Request syntax with placeholder values
295
- #
296
- # group = group.update({
297
- # new_path: "pathType",
298
- # new_group_name: "groupNameType",
299
- # })
300
- # @param [Hash] options ({})
301
- # @option options [String] :new_path
302
- # New path for the IAM group. Only include this if changing the group's
303
- # path.
304
- #
305
- # The [regex pattern][1] for this parameter is a string of characters
306
- # consisting of either a forward slash (/) by itself or a string that
307
- # must begin and end with forward slashes, containing any ASCII
308
- # character from the ! (\\u0021) thru the DEL character (\\u007F),
309
- # including most punctuation characters, digits, and upper and
310
- # lowercased letters.
311
- #
312
- #
313
- #
314
- # [1]: http://wikipedia.org/wiki/regex
315
- # @option options [String] :new_group_name
316
- # New name for the IAM group. Only include this if changing the group's
317
- # name.
318
- #
319
- # The [regex pattern][1] for this parameter is a string of characters
320
- # consisting of upper and lowercase alphanumeric characters with no
321
- # spaces. You can also include any of the following characters: =,.@-
322
- #
323
- #
324
- #
325
- # [1]: http://wikipedia.org/wiki/regex
326
- # @return [Group]
327
- def update(options = {})
328
- options = options.merge(group_name: @name)
329
- resp = @client.update_group(options)
330
- Group.new(
331
- name: options[:new_group_name],
332
- client: @client
333
- )
334
- end
298
+ # @example Request syntax with placeholder values
299
+ #
300
+ # group = group.update({
301
+ # new_path: "pathType",
302
+ # new_group_name: "groupNameType",
303
+ # })
304
+ # @param [Hash] options ({})
305
+ # @option options [String] :new_path
306
+ # New path for the IAM group. Only include this if changing the group's
307
+ # path.
308
+ #
309
+ # This paramater allows (per its [regex pattern][1]) a string of
310
+ # characters consisting of either a forward slash (/) by itself or a
311
+ # string that must begin and end with forward slashes, containing any
312
+ # ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
313
+ # including most punctuation characters, digits, and upper and
314
+ # lowercased letters.
315
+ #
316
+ #
317
+ #
318
+ # [1]: http://wikipedia.org/wiki/regex
319
+ # @option options [String] :new_group_name
320
+ # New name for the IAM group. Only include this if changing the group's
321
+ # name.
322
+ #
323
+ # This parameter allows (per its [regex pattern][1]) a string of
324
+ # characters consisting of upper and lowercase alphanumeric characters
325
+ # with no spaces. You can also include any of the following characters:
326
+ # =,.@-
327
+ #
328
+ #
329
+ #
330
+ # [1]: http://wikipedia.org/wiki/regex
331
+ # @return [Group]
332
+ def update(options = {})
333
+ options = options.merge(group_name: @name)
334
+ resp = @client.update_group(options)
335
+ Group.new(
336
+ name: options[:new_group_name],
337
+ client: @client
338
+ )
339
+ end
335
340
 
336
- # @!group Associations
337
-
338
- # @example Request syntax with placeholder values
339
- #
340
- # attachedpolicies = group.attached_policies({
341
- # path_prefix: "policyPathType",
342
- # })
343
- # @param [Hash] options ({})
344
- # @option options [String] :path_prefix
345
- # The path prefix for filtering the results. This parameter is optional.
346
- # If it is not included, it defaults to a slash (/), listing all
347
- # policies.
348
- #
349
- # The [regex pattern][1] for this parameter is a string of characters
350
- # consisting of either a forward slash (/) by itself or a string that
351
- # must begin and end with forward slashes, containing any ASCII
352
- # character from the ! (\\u0021) thru the DEL character (\\u007F),
353
- # including most punctuation characters, digits, and upper and
354
- # lowercased letters.
355
- #
356
- #
357
- #
358
- # [1]: http://wikipedia.org/wiki/regex
359
- # @return [Policy::Collection]
360
- def attached_policies(options = {})
361
- batches = Enumerator.new do |y|
362
- options = options.merge(group_name: @name)
363
- resp = @client.list_attached_group_policies(options)
364
- resp.each_page do |page|
365
- batch = []
366
- page.data.attached_policies.each do |a|
367
- batch << Policy.new(
368
- arn: a.policy_arn,
369
- client: @client
370
- )
371
- end
372
- y.yield(batch)
341
+ # @!group Associations
342
+
343
+ # @example Request syntax with placeholder values
344
+ #
345
+ # attached_policies = group.attached_policies({
346
+ # path_prefix: "policyPathType",
347
+ # })
348
+ # @param [Hash] options ({})
349
+ # @option options [String] :path_prefix
350
+ # The path prefix for filtering the results. This parameter is optional.
351
+ # If it is not included, it defaults to a slash (/), listing all
352
+ # policies.
353
+ #
354
+ # This paramater allows (per its [regex pattern][1]) a string of
355
+ # characters consisting of either a forward slash (/) by itself or a
356
+ # string that must begin and end with forward slashes, containing any
357
+ # ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
358
+ # including most punctuation characters, digits, and upper and
359
+ # lowercased letters.
360
+ #
361
+ #
362
+ #
363
+ # [1]: http://wikipedia.org/wiki/regex
364
+ # @return [Policy::Collection]
365
+ def attached_policies(options = {})
366
+ batches = Enumerator.new do |y|
367
+ options = options.merge(group_name: @name)
368
+ resp = @client.list_attached_group_policies(options)
369
+ resp.each_page do |page|
370
+ batch = []
371
+ page.data.attached_policies.each do |a|
372
+ batch << Policy.new(
373
+ arn: a.policy_arn,
374
+ client: @client
375
+ )
373
376
  end
377
+ y.yield(batch)
374
378
  end
375
- Policy::Collection.new(batches)
376
379
  end
380
+ Policy::Collection.new(batches)
381
+ end
377
382
 
378
- # @example Request syntax with placeholder values
379
- #
380
- # policies = group.policies()
381
- # @param [Hash] options ({})
382
- # @return [GroupPolicy::Collection]
383
- def policies(options = {})
384
- batches = Enumerator.new do |y|
385
- options = options.merge(group_name: @name)
386
- resp = @client.list_group_policies(options)
387
- resp.each_page do |page|
388
- batch = []
389
- page.data.policy_names.each do |p|
390
- batch << GroupPolicy.new(
391
- group_name: @name,
392
- name: p,
393
- client: @client
394
- )
395
- end
396
- y.yield(batch)
383
+ # @example Request syntax with placeholder values
384
+ #
385
+ # group.policies()
386
+ # @param [Hash] options ({})
387
+ # @return [GroupPolicy::Collection]
388
+ def policies(options = {})
389
+ batches = Enumerator.new do |y|
390
+ options = options.merge(group_name: @name)
391
+ resp = @client.list_group_policies(options)
392
+ resp.each_page do |page|
393
+ batch = []
394
+ page.data.policy_names.each do |p|
395
+ batch << GroupPolicy.new(
396
+ group_name: @name,
397
+ name: p,
398
+ client: @client
399
+ )
397
400
  end
401
+ y.yield(batch)
398
402
  end
399
- GroupPolicy::Collection.new(batches)
400
403
  end
404
+ GroupPolicy::Collection.new(batches)
405
+ end
401
406
 
402
- # @param [String] name
403
- # @return [GroupPolicy]
404
- def policy(name)
405
- GroupPolicy.new(
406
- group_name: @name,
407
- name: name,
408
- client: @client
409
- )
410
- end
407
+ # @param [String] name
408
+ # @return [GroupPolicy]
409
+ def policy(name)
410
+ GroupPolicy.new(
411
+ group_name: @name,
412
+ name: name,
413
+ client: @client
414
+ )
415
+ end
411
416
 
412
- # @example Request syntax with placeholder values
413
- #
414
- # users = group.users()
415
- # @param [Hash] options ({})
416
- # @return [User::Collection]
417
- def users(options = {})
418
- batches = Enumerator.new do |y|
419
- options = options.merge(group_name: @name)
420
- resp = @client.get_group(options)
421
- resp.each_page do |page|
422
- batch = []
423
- page.data.users.each do |u|
424
- batch << User.new(
425
- name: u.user_name,
426
- data: u,
427
- client: @client
428
- )
429
- end
430
- y.yield(batch)
417
+ # @example Request syntax with placeholder values
418
+ #
419
+ # group.users()
420
+ # @param [Hash] options ({})
421
+ # @return [User::Collection]
422
+ def users(options = {})
423
+ batches = Enumerator.new do |y|
424
+ options = options.merge(group_name: @name)
425
+ resp = @client.get_group(options)
426
+ resp.each_page do |page|
427
+ batch = []
428
+ page.data.users.each do |u|
429
+ batch << User.new(
430
+ name: u.user_name,
431
+ data: u,
432
+ client: @client
433
+ )
431
434
  end
435
+ y.yield(batch)
432
436
  end
433
- User::Collection.new(batches)
434
437
  end
438
+ User::Collection.new(batches)
439
+ end
435
440
 
436
- # @deprecated
437
- # @api private
438
- def identifiers
439
- { name: @name }
440
- end
441
- deprecated(:identifiers)
442
-
443
- private
444
-
445
- def extract_name(args, options)
446
- value = args[0] || options.delete(:name)
447
- case value
448
- when String then value
449
- when nil then raise ArgumentError, "missing required option :name"
450
- else
451
- msg = "expected :name to be a String, got #{value.class}"
452
- raise ArgumentError, msg
453
- end
441
+ # @deprecated
442
+ # @api private
443
+ def identifiers
444
+ { name: @name }
445
+ end
446
+ deprecated(:identifiers)
447
+
448
+ private
449
+
450
+ def extract_name(args, options)
451
+ value = args[0] || options.delete(:name)
452
+ case value
453
+ when String then value
454
+ when nil then raise ArgumentError, "missing required option :name"
455
+ else
456
+ msg = "expected :name to be a String, got #{value.class}"
457
+ raise ArgumentError, msg
454
458
  end
455
-
456
- class Collection < Aws::Resources::Collection; end
457
459
  end
460
+
461
+ class Collection < Aws::Resources::Collection; end
458
462
  end
459
463
  end