Designates an account as the delegated Amazon Macie administrator account for an organization in Organizations.
Parameters:
-
admin_account_id
(Optional[__string], default:
None
)
–
The Amazon Web Services account ID for the account to designate as the delegated Amazon Macie administrator account for the organization.
-
client_token
(Optional[__string], default:
None
)
–
A unique, case-sensitive token that you provide to ensure the idempotency of the request.
Raises:
-
AccessDeniedException
–
Provides information about an error that occurred due to insufficient access to a specified resource.
-
ConflictException
–
Provides information about an error that occurred due to a versioning conflict for a specified resource.
-
InternalServerException
–
Provides information about an error that occurred due to an unknown internal server error, exception, or failure.
-
ResourceNotFoundException
–
Provides information about an error that occurred because a specified resource wasn't found.
-
ServiceQuotaExceededException
–
Provides information about an error that occurred due to one or more service quotas for an account.
-
ThrottlingException
–
Provides information about an error that occurred because too many requests were sent during a certain amount of time.
-
ValidationException
–
Provides information about an error that occurred due to a syntax error in a request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_macie2/_services/async_macie2.py
| async def enable_organization_admin_account(
self,
*,
config_overrides: Optional[AsyncMacie2ClientConfig] = None,
admin_account_id: Optional["capo_macie2.types.__string.__string"] = None,
client_token: Optional["capo_macie2.types.__string.__string"] = None,
) -> "capo_macie2.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse":
"""<p>Designates an account as the delegated Amazon Macie administrator account for an organization in Organizations.</p>
Args:
admin_account_id: <p>The Amazon Web Services account ID for the account to designate as the delegated Amazon Macie administrator account for the organization.</p>
client_token: <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
Raises:
capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
capo_macie2.errors.conflict_exception.ConflictException: <p>Provides information about an error that occurred due to a versioning conflict for a specified resource.</p>
capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_macie2.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest]",
) -> AsyncOperationResponse[
"capo_macie2.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse"
]:
import capo_macie2._operations.macie2.enable_organization_admin_account
(
output,
http_response,
) = await capo_macie2._operations.macie2.enable_organization_admin_account.async_enable_organization_admin_account(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("EnableOrganizationAdminAccount")
)
input_: capo_macie2.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest = {}
if admin_account_id is not None:
input_["admin_account_id"] = admin_account_id
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|