updateAccessPolicy method
Updates an existing access policy that specifies an identity's access to an IoT SiteWise Monitor portal or project resource.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter accessPolicyId :
The ID of the access policy.
Parameter accessPolicyIdentity :
The identity for this access policy. Choose an IAM Identity Center user,
an IAM Identity Center group, or an IAM user.
Parameter accessPolicyPermission :
The permission level for this access policy. Note that a project
ADMINISTRATOR is also known as a project owner.
Parameter accessPolicyResource :
The IoT SiteWise Monitor resource for this access policy. Choose either a
portal or a project.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Implementation
Future<void> updateAccessPolicy({
required String accessPolicyId,
required Identity accessPolicyIdentity,
required Permission accessPolicyPermission,
required Resource accessPolicyResource,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'accessPolicyIdentity': accessPolicyIdentity,
'accessPolicyPermission': accessPolicyPermission.value,
'accessPolicyResource': accessPolicyResource,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/access-policies/${Uri.encodeComponent(accessPolicyId)}',
hostPrefix: 'monitor.',
exceptionFnMap: _exceptionFns,
);
}