ListRolesAsync() public method

Initiates the asynchronous execution of the ListRoles operation.
public ListRolesAsync ( ListRolesRequest request, System cancellationToken = default(CancellationToken) ) : Task
request ListRolesRequest Container for the necessary parameters to execute the ListRoles operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
 private async Task<bool> RoleAlreadyExistsAsync()
 {
     using (
         var iamClient = new AmazonIdentityManagementServiceClient(credentials,
             configurationProvider.RegionEndpoint))
     {
         var listRolesResponse = await iamClient.ListRolesAsync();
         return listRolesResponse.Roles
             .Any(r => string.Equals(r.RoleName, configurationProvider.ShortApplicationName,
                 StringComparison.CurrentCultureIgnoreCase));
     }
 }