listCustomerManagedPolicyReferencesInPermissionSet method

Future<ListCustomerManagedPolicyReferencesInPermissionSetResponse> listCustomerManagedPolicyReferencesInPermissionSet({
  1. required String instanceArn,
  2. required String permissionSetArn,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all customer managed policies attached to a specified PermissionSet.

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

Parameter instanceArn : The ARN of the IAM Identity Center instance under which the operation will be executed.

Parameter permissionSetArn : The ARN of the PermissionSet.

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

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.

Implementation

Future<ListCustomerManagedPolicyReferencesInPermissionSetResponse>
    listCustomerManagedPolicyReferencesInPermissionSet({
  required String instanceArn,
  required String permissionSetArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'SWBExternalService.ListCustomerManagedPolicyReferencesInPermissionSet'
  };
  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,
    },
  );

  return ListCustomerManagedPolicyReferencesInPermissionSetResponse.fromJson(
      jsonResponse.body);
}