listPolicyAttachments method
- required String directoryArn,
- required ObjectReference policyReference,
- ConsistencyLevel? consistencyLevel,
- int? maxResults,
- String? nextToken,
Returns all of the ObjectIdentifiers
to which a given policy
is attached.
May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw InvalidNextTokenException. May throw ResourceNotFoundException. May throw NotPolicyException.
Parameter directoryArn
:
The Amazon Resource Name (ARN) that is associated with the
Directory where objects reside. For more information, see
arns.
Parameter policyReference
:
The reference that identifies the policy object.
Parameter consistencyLevel
:
Represents the manner and timing in which the successful write or update
of an object is reflected in a subsequent read operation of that same
object.
Parameter maxResults
:
The maximum number of items to be retrieved in a single call. This is an
approximate number.
Parameter nextToken
:
The pagination token.
Implementation
Future<ListPolicyAttachmentsResponse> listPolicyAttachments({
required String directoryArn,
required ObjectReference policyReference,
ConsistencyLevel? consistencyLevel,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(directoryArn, 'directoryArn');
ArgumentError.checkNotNull(policyReference, 'policyReference');
_s.validateNumRange(
'maxResults',
maxResults,
1,
1152921504606846976,
);
final headers = <String, String>{
'x-amz-data-partition': directoryArn.toString(),
if (consistencyLevel != null)
'x-amz-consistency-level': consistencyLevel.toValue(),
};
final $payload = <String, dynamic>{
'PolicyReference': policyReference,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/amazonclouddirectory/2017-01-11/policy/attachment',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ListPolicyAttachmentsResponse.fromJson(response);
}