Skip to content

enable_organization_admin_account async

enable_organization_admin_account(
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    admin_account_id: Optional[String] = None,
) -> EnableOrganizationAdminAccountResponse

Designates an Amazon Web Services account within the organization as your GuardDuty delegated administrator. Only the organization's management account can run this API operation.

Parameters:

  • admin_account_id (Optional[String], default: None ) –

    The Amazon Web Services account ID for the organization account to be enabled as a GuardDuty delegated administrator.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def enable_organization_admin_account(
    self,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    admin_account_id: Optional["capo_guardduty.types.string.String"] = None,
) -> "capo_guardduty.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse":
    """<p>Designates an Amazon Web Services account within the organization as your GuardDuty delegated administrator. Only the organization's management account can run this API operation.</p>

    Args:
        admin_account_id: <p>The Amazon Web Services account ID for the organization account to be enabled as a GuardDuty delegated administrator.</p>

    Raises:
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_guardduty.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.enable_organization_admin_account_response.EnableOrganizationAdminAccountResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.enable_organization_admin_account

        (
            output,
            http_response,
        ) = await capo_guardduty._operations.guard_duty_api_service.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_guardduty.types.enable_organization_admin_account_request.EnableOrganizationAdminAccountRequest = {}
    if admin_account_id is not None:
        input_["admin_account_id"] = admin_account_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output