listAccountsForProvisionedPermissionSet method

Future<ListAccountsForProvisionedPermissionSetResponse> listAccountsForProvisionedPermissionSet({
  1. required String instanceArn,
  2. required String permissionSetArn,
  3. int? maxResults,
  4. String? nextToken,
  5. ProvisioningStatus? provisioningStatus,
})

Lists all the AWS accounts where the specified permission set is provisioned.

May throw ResourceNotFoundException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException. May throw AccessDeniedException.

Parameter instanceArn : The ARN of the SSO instance under which the operation will be executed. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Parameter permissionSetArn : The ARN of the PermissionSet from which the associated AWS accounts will be listed.

Parameter maxResults : The maximum number of results to display for the PermissionSet.

Parameter nextToken : The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make subsequent calls.

Parameter provisioningStatus : The permission set provisioning status for an AWS account.

Implementation

Future<ListAccountsForProvisionedPermissionSetResponse>
    listAccountsForProvisionedPermissionSet({
  required String instanceArn,
  required String permissionSetArn,
  int? maxResults,
  String? nextToken,
  ProvisioningStatus? provisioningStatus,
}) async {
  ArgumentError.checkNotNull(instanceArn, 'instanceArn');
  _s.validateStringLength(
    'instanceArn',
    instanceArn,
    10,
    1224,
    isRequired: true,
  );
  ArgumentError.checkNotNull(permissionSetArn, 'permissionSetArn');
  _s.validateStringLength(
    'permissionSetArn',
    permissionSetArn,
    10,
    1224,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'SWBExternalService.ListAccountsForProvisionedPermissionSet'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceArn': instanceArn,
      'PermissionSetArn': permissionSetArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (provisioningStatus != null)
        'ProvisioningStatus': provisioningStatus.toValue(),
    },
  );

  return ListAccountsForProvisionedPermissionSetResponse.fromJson(
      jsonResponse.body);
}