Tags the resource with a tag key and value.
For more information, see Tagging your Amazon Web Services resources in the Tagging Amazon Web Services Resources User Guide.
This is only supported for NotificationConfigurations.
Parameters:
-
arn
(NotificationConfigurationArn)
–
The Amazon Resource Name (ARN) to use to tag a resource.
-
tags
(TagMap)
–
A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.
Raises:
Source code in docs_src/capo_notifications/_services/async_notifications.py
| async def tag_resource(
self,
arn: "capo_notifications.types.notification_configuration_arn.NotificationConfigurationArn",
tags: "capo_notifications.types.tag_map.TagMap",
*,
config_overrides: Optional[AsyncNotificationsClientConfig] = None,
) -> "capo_notifications.types.tag_resource_response.TagResourceResponse":
"""<p>Tags the resource with a tag key and value.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging your Amazon Web Services resources</a> in the <i>Tagging Amazon Web Services Resources User Guide</i>.</p> <note> <p>This is only supported for <code>NotificationConfigurations</code>.</p> </note>
Args:
arn: <p>The Amazon Resource Name (ARN) to use to tag a resource.</p>
tags: <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
Raises:
capo_notifications.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
capo_notifications.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
capo_notifications.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist. </p>
capo_notifications.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling. </p>
capo_notifications.errors.validation_exception.ValidationException: <p>This exception is thrown when the notification event fails validation.</p>
capo_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_notifications.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_notifications.types.tag_resource_response.TagResourceResponse"
]:
import capo_notifications._operations.notifications.tag_resource
(
output,
http_response,
) = await capo_notifications._operations.notifications.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_notifications.types.tag_resource_request.TagResourceRequest = {
"arn": arn,
"tags": tags,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|