async def subscribe(
self,
arn: "capo_codestar_notifications.types.notification_rule_arn.NotificationRuleArn",
target: "capo_codestar_notifications.types.target.Target",
*,
config_overrides: Optional[AsynccodestarnotificationsClientConfig] = None,
client_request_token: Optional[
"capo_codestar_notifications.types.client_request_token.ClientRequestToken"
] = None,
) -> "capo_codestar_notifications.types.subscribe_result.SubscribeResult":
"""<p>Creates an association between a notification rule and an Amazon Q Developer in chat applications topic or Amazon Q Developer in chat applications client so that the associated target can receive notifications when the events described in the rule are triggered.</p>
Args:
arn: <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
client_request_token: <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
Raises:
capo_codestar_notifications.errors.configuration_exception.ConfigurationException: <p>Some or all of the configuration is incomplete, missing, or not valid.</p>
capo_codestar_notifications.errors.resource_not_found_exception.ResourceNotFoundException: <p>CodeStar Notifications can't find a resource that matches the provided ARN. </p>
capo_codestar_notifications.errors.validation_exception.ValidationException: <p>One or more parameter values are not valid.</p>
capo_codestar_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_codestar_notifications.types.subscribe_request.SubscribeRequest]",
) -> AsyncOperationResponse[
"capo_codestar_notifications.types.subscribe_result.SubscribeResult"
]:
import capo_codestar_notifications._operations.code_star_notifications_20191015.subscribe
(
output,
http_response,
) = await capo_codestar_notifications._operations.code_star_notifications_20191015.subscribe.async_subscribe(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_codestar_notifications.types.subscribe_request.SubscribeRequest",
) -> dict[str, Any]:
import capo_codestar_notifications.types.subscribe_request
return capo_codestar_notifications.types.subscribe_request.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("Subscribe", redact_input=_redact_input)
)
input_: capo_codestar_notifications.types.subscribe_request.SubscribeRequest = {
"arn": arn,
"target": target,
}
if client_request_token is not None:
input_["client_request_token"] = client_request_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output