listServiceSpecificCredentials method
Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an Amazon Web Services service, see Set up service-specific credentials in the CodeCommit User Guide.
May throw NoSuchEntityException.
May throw ServiceNotSupportedException.
Parameter allUsers :
A flag indicating whether to list service specific credentials for all
users. This parameter cannot be specified together with UserName. When
true, returns all credentials associated with the specified service.
Parameter marker :
Use this parameter only when paginating results and only after you receive
a response indicating that the results are truncated. Set it to the value
of the Marker from the response that you received to indicate where the
next call should start.
Parameter maxItems :
Use this only when paginating results to indicate the maximum number of
items you want in the response. If additional items exist beyond the
maximum you specify, the IsTruncated response element is true.
Parameter serviceName :
Filters the returned results to only those for the specified Amazon Web
Services service. If not specified, then Amazon Web Services returns
service-specific credentials for all services.
Parameter userName :
The name of the user whose service-specific credentials you want
information about. If this value is not specified, then the operation
assumes the user whose credentials are used to call the operation.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Implementation
Future<ListServiceSpecificCredentialsResponse>
listServiceSpecificCredentials({
bool? allUsers,
String? marker,
int? maxItems,
String? serviceName,
String? userName,
}) async {
_s.validateNumRange(
'maxItems',
maxItems,
1,
1000,
);
final $request = <String, String>{
if (allUsers != null) 'AllUsers': allUsers.toString(),
if (marker != null) 'Marker': marker,
if (maxItems != null) 'MaxItems': maxItems.toString(),
if (serviceName != null) 'ServiceName': serviceName,
if (userName != null) 'UserName': userName,
};
final $result = await _protocol.send(
$request,
action: 'ListServiceSpecificCredentials',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'ListServiceSpecificCredentialsResult',
);
return ListServiceSpecificCredentialsResponse.fromXml($result);
}