Accepts the invitation to be monitored by a GuardDuty administrator account.
Parameters:
-
detector_id
(DetectorId)
–
The unique ID of the detector of the GuardDuty member account.
To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.
-
master_id
(Optional[String], default:
None
)
–
The account ID of the GuardDuty administrator account whose invitation you're accepting.
-
invitation_id
(Optional[String], default:
None
)
–
The value that is used to validate the administrator account to the member account.
Raises:
Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
| async def accept_invitation(
self,
detector_id: "capo_guardduty.types.detector_id.DetectorId",
*,
config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
master_id: Optional["capo_guardduty.types.string.String"] = None,
invitation_id: Optional["capo_guardduty.types.string.String"] = None,
) -> "capo_guardduty.types.accept_invitation_response.AcceptInvitationResponse":
"""<p>Accepts the invitation to be monitored by a GuardDuty administrator account.</p>
Args:
detector_id: <p>The unique ID of the detector of the GuardDuty member account.</p> <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
master_id: <p>The account ID of the GuardDuty administrator account whose invitation you're accepting.</p>
invitation_id: <p>The value that is used to validate the administrator account to the member account.</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.accept_invitation_request.AcceptInvitationRequest]",
) -> AsyncOperationResponse[
"capo_guardduty.types.accept_invitation_response.AcceptInvitationResponse"
]:
import capo_guardduty._operations.guard_duty_api_service.accept_invitation
(
output,
http_response,
) = await capo_guardduty._operations.guard_duty_api_service.accept_invitation.async_accept_invitation(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AcceptInvitation")
)
input_: capo_guardduty.types.accept_invitation_request.AcceptInvitationRequest = {
"detector_id": detector_id
}
if master_id is not None:
input_["master_id"] = master_id
if invitation_id is not None:
input_["invitation_id"] = invitation_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|