Class: AWS::IAM::GroupUserCollection
- Inherits:
-
Object
- Object
- AWS::IAM::GroupUserCollection
- Includes:
- Core::Collection::Simple
- Defined in:
- lib/aws/iam/group_user_collection.rb
Overview
Instance Attribute Summary collapse
- #group ⇒ Object readonly
Instance Method Summary collapse
-
#add(user) ⇒ nil
Adds a user to the group.
-
#clear ⇒ nil
Removes all users from this group.
-
#remove(user) ⇒ nil
Remove a user from the group.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Instance Attribute Details
#group ⇒ Object (readonly)
35 36 37 |
# File 'lib/aws/iam/group_user_collection.rb', line 35 def group @group end |
Instance Method Details
#add(user) ⇒ nil
Adds a user to the group.
41 42 43 44 45 46 47 48 49 |
# File 'lib/aws/iam/group_user_collection.rb', line 41 def add(user) client.add_user_to_group( :group_name => group.name, :user_name => user.name) nil end |
#clear ⇒ nil
Removes all users from this group.
67 68 69 |
# File 'lib/aws/iam/group_user_collection.rb', line 67 def clear each {|user| remove(user) } end |
#remove(user) ⇒ nil
Remove a user from the group.
55 56 57 58 59 60 61 62 63 |
# File 'lib/aws/iam/group_user_collection.rb', line 55 def remove(user) client.remove_user_from_group( :group_name => group.name, :user_name => user.name) nil end |