lib/aws-sdk-iam/group.rb in aws-sdk-iam-1.77.0 vs lib/aws-sdk-iam/group.rb in aws-sdk-iam-1.78.0
- old
+ new
@@ -93,11 +93,13 @@
#
# group.reload.data
#
# @return [self]
def load
- resp = @client.get_group(group_name: @name)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.get_group(group_name: @name)
+ end
@data = resp.group
self
end
alias :reload :load
@@ -208,11 +210,13 @@
else
self_copy.reload unless attempts == options[:max_attempts]
:retry
end
end
- Aws::Waiters::Waiter.new(options).wait({})
+ Aws::Plugins::UserAgent.feature('resource') do
+ Aws::Waiters::Waiter.new(options).wait({})
+ end
end
# @!group Actions
# @example Request syntax with placeholder values
@@ -233,11 +237,13 @@
#
# [1]: http://wikipedia.org/wiki/regex
# @return [EmptyStructure]
def add_user(options = {})
options = options.merge(group_name: @name)
- resp = @client.add_user_to_group(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.add_user_to_group(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -255,11 +261,13 @@
#
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
# @return [EmptyStructure]
def attach_policy(options = {})
options = options.merge(group_name: @name)
- resp = @client.attach_group_policy(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.attach_group_policy(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -286,11 +294,13 @@
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
# [2]: http://wikipedia.org/wiki/regex
# @return [Group]
def create(options = {})
options = options.merge(group_name: @name)
- resp = @client.create_group(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.create_group(options)
+ end
Group.new(
name: options[:group_name],
data: resp.data.group,
client: @client
)
@@ -338,11 +348,13 @@
#
# [1]: http://wikipedia.org/wiki/regex
# @return [GroupPolicy]
def create_policy(options = {})
options = options.merge(group_name: @name)
- @client.put_group_policy(options)
+ Aws::Plugins::UserAgent.feature('resource') do
+ @client.put_group_policy(options)
+ end
GroupPolicy.new(
group_name: @name,
name: options[:policy_name],
client: @client
)
@@ -353,11 +365,13 @@
# group.delete()
# @param [Hash] options ({})
# @return [EmptyStructure]
def delete(options = {})
options = options.merge(group_name: @name)
- resp = @client.delete_group(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.delete_group(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -375,11 +389,13 @@
#
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
# @return [EmptyStructure]
def detach_policy(options = {})
options = options.merge(group_name: @name)
- resp = @client.detach_group_policy(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.detach_group_policy(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -399,11 +415,13 @@
#
# [1]: http://wikipedia.org/wiki/regex
# @return [EmptyStructure]
def remove_user(options = {})
options = options.merge(group_name: @name)
- resp = @client.remove_user_from_group(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.remove_user_from_group(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -434,11 +452,13 @@
# account. Names are not distinguished by case. For example, you cannot
# create resources named both "MyResource" and "myresource".
# @return [Group]
def update(options = {})
options = options.merge(group_name: @name)
- @client.update_group(options)
+ Aws::Plugins::UserAgent.feature('resource') do
+ @client.update_group(options)
+ end
Group.new(
name: options[:new_group_name],
client: @client
)
end
@@ -468,11 +488,13 @@
# [1]: http://wikipedia.org/wiki/regex
# @return [Policy::Collection]
def attached_policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(group_name: @name)
- resp = @client.list_attached_group_policies(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.list_attached_group_policies(options)
+ end
resp.each_page do |page|
batch = []
page.data.attached_policies.each do |a|
batch << Policy.new(
arn: a.policy_arn,
@@ -491,11 +513,13 @@
# @param [Hash] options ({})
# @return [GroupPolicy::Collection]
def policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(group_name: @name)
- resp = @client.list_group_policies(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.list_group_policies(options)
+ end
resp.each_page do |page|
batch = []
page.data.policy_names.each do |p|
batch << GroupPolicy.new(
group_name: @name,
@@ -525,10 +549,12 @@
# @param [Hash] options ({})
# @return [User::Collection]
def users(options = {})
batches = Enumerator.new do |y|
options = options.merge(group_name: @name)
- resp = @client.get_group(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.get_group(options)
+ end
resp.each_page do |page|
batch = []
page.data.users.each do |u|
batch << User.new(
name: u.user_name,