@@ -19,26 +19,6 @@ public IAMWrapper(IAmazonIdentityManagementService IAMService)
1919 _IAMService = IAMService ;
2020 }
2121
22- // snippet-start:[IAM.dotnetv3.AddUserToGroup]
23- /// <summary>
24- /// Add an existing IAM user to an existing IAM group.
25- /// </summary>
26- /// <param name="userName">The username of the user to add.</param>
27- /// <param name="groupName">The name of the group to add the user to.</param>
28- /// <returns>A Boolean value indicating the success of the action.</returns>
29- public async Task < bool > AddUserToGroupAsync ( string userName , string groupName )
30- {
31- var response = await _IAMService . AddUserToGroupAsync ( new AddUserToGroupRequest
32- {
33- GroupName = groupName ,
34- UserName = userName ,
35- } ) ;
36-
37- return response . HttpStatusCode == HttpStatusCode . OK ;
38- }
39-
40- // snippet-end:[IAM.dotnetv3.AddUserToGroup]
41-
4222 // snippet-start:[IAM.dotnetv3.AttachRolePolicy]
4323 /// <summary>
4424 /// Attach an IAM policy to a role.
@@ -79,20 +59,6 @@ public async Task<AccessKey> CreateAccessKeyAsync(string userName)
7959
8060 // snippet-end:[IAM.dotnetv3.CreateAccessKey]
8161
82- // snippet-start:[IAM.dotnetv3.CreateGroup]
83- /// <summary>
84- /// Create an IAM group.
85- /// </summary>
86- /// <param name="groupName">The name to give the IAM group.</param>
87- /// <returns>The IAM group that was created.</returns>
88- public async Task < Group > CreateGroupAsync ( string groupName )
89- {
90- var response = await _IAMService . CreateGroupAsync ( new CreateGroupRequest { GroupName = groupName } ) ;
91- return response . Group ;
92- }
93-
94- // snippet-end:[IAM.dotnetv3.CreateGroup]
95-
9662 // snippet-start:[IAM.dotnetv3.CreatePolicy]
9763 /// <summary>
9864 /// Create an IAM policy.
@@ -191,42 +157,6 @@ public async Task<bool> DeleteAccessKeyAsync(string accessKeyId, string userName
191157
192158 // snippet-end:[IAM.dotnetv3.DeleteAccessKey]
193159
194- // snippet-start:[IAM.dotnetv3.DeleteGroup]
195- /// <summary>
196- /// Delete an IAM group.
197- /// </summary>
198- /// <param name="groupName">The name of the IAM group to delete.</param>
199- /// <returns>A Boolean value indicating the success of the action.</returns>
200- public async Task < bool > DeleteGroupAsync ( string groupName )
201- {
202- var response = await _IAMService . DeleteGroupAsync ( new DeleteGroupRequest { GroupName = groupName } ) ;
203- return response . HttpStatusCode == HttpStatusCode . OK ;
204- }
205-
206- // snippet-end:[IAM.dotnetv3.DeleteGroup]
207-
208- // snippet-start:[IAM.dotnetv3.DeleteGroupPolicy]
209- /// <summary>
210- /// Delete an IAM policy associated with an IAM group.
211- /// </summary>
212- /// <param name="groupName">The name of the IAM group associated with the
213- /// policy.</param>
214- /// <param name="policyName">The name of the policy to delete.</param>
215- /// <returns>A Boolean value indicating the success of the action.</returns>
216- public async Task < bool > DeleteGroupPolicyAsync ( string groupName , string policyName )
217- {
218- var request = new DeleteGroupPolicyRequest ( )
219- {
220- GroupName = groupName ,
221- PolicyName = policyName ,
222- } ;
223-
224- var response = await _IAMService . DeleteGroupPolicyAsync ( request ) ;
225- return response . HttpStatusCode == System . Net . HttpStatusCode . OK ;
226- }
227-
228- // snippet-end:[IAM.dotnetv3.DeleteGroupPolicy]
229-
230160 // snippet-start:[IAM.dotnetv3.DeletePolicy]
231161 /// <summary>
232162 /// Delete an IAM policy.
@@ -523,51 +453,6 @@ public async Task<List<User>> ListUsersAsync()
523453
524454 // snippet-end:[IAM.dotnetv3.ListUsers]
525455
526- // snippet-start:[IAM.dotnetv3.RemoveUserFromGroup]
527- /// <summary>
528- /// Remove a user from an IAM group.
529- /// </summary>
530- /// <param name="userName">The username of the user to remove.</param>
531- /// <param name="groupName">The name of the IAM group to remove the user from.</param>
532- /// <returns>A Boolean value indicating the success of the action.</returns>
533- public async Task < bool > RemoveUserFromGroupAsync ( string userName , string groupName )
534- {
535- // Remove the user from the group.
536- var removeUserRequest = new RemoveUserFromGroupRequest ( )
537- {
538- UserName = userName ,
539- GroupName = groupName ,
540- } ;
541-
542- var response = await _IAMService . RemoveUserFromGroupAsync ( removeUserRequest ) ;
543- return response . HttpStatusCode == HttpStatusCode . OK ;
544- }
545-
546- // snippet-end:[IAM.dotnetv3.RemoveUserFromGroup]
547-
548- // snippet-start:[IAM.dotnetv3.PutGroupPolicy]
549- /// <summary>
550- /// Add or update an inline policy document that is embedded in an IAM group.
551- /// </summary>
552- /// <param name="groupName">The name of the IAM group.</param>
553- /// <param name="policyName">The name of the IAM policy.</param>
554- /// <param name="policyDocument">The policy document defining the IAM policy.</param>
555- /// <returns>A Boolean value indicating the success of the action.</returns>
556- public async Task < bool > PutGroupPolicyAsync ( string groupName , string policyName , string policyDocument )
557- {
558- var request = new PutGroupPolicyRequest
559- {
560- GroupName = groupName ,
561- PolicyName = policyName ,
562- PolicyDocument = policyDocument
563- } ;
564-
565- var response = await _IAMService . PutGroupPolicyAsync ( request ) ;
566- return response . HttpStatusCode == System . Net . HttpStatusCode . OK ;
567- }
568-
569- // snippet-end:[IAM.dotnetv3.PutGroupPolicy]
570-
571456 // snippet-start:[IAM.dotnetv3.PutRolePolicy]
572457 /// <summary>
573458 /// Update the inline policy document embedded in a role.
0 commit comments