Skip to content

tag_resource async

tag_resource(
    arn: EmailContactArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncNotificationsContactsClientConfig] = None,
) -> TagResourceResponse

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts.

Parameters:

  • arn (EmailContactArn) –

    The ARN of the configuration.

  • tags (TagMap) –

    A list of tags to apply to the configuration.

Raises:

Source code in docs_src/capo_notificationscontacts/_services/async_notifications_contacts.py
async def tag_resource(
    self,
    arn: "capo_notificationscontacts.types.email_contact_arn.EmailContactArn",
    tags: "capo_notificationscontacts.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncNotificationsContactsClientConfig] = None,
) -> "capo_notificationscontacts.types.tag_resource_response.TagResourceResponse":
    """<p>Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts.</p>

    Args:
        arn: <p>The ARN of the configuration.</p>
        tags: <p>A list of tags to apply to the configuration.</p>

    Raises:
        capo_notificationscontacts.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_notificationscontacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_notificationscontacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Your request references a resource which does not exist. </p>
        capo_notificationscontacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_notificationscontacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_notificationscontacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_notificationscontacts.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_notificationscontacts.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_notificationscontacts._operations.notifications_contacts.tag_resource

        (
            output,
            http_response,
        ) = await capo_notificationscontacts._operations.notifications_contacts.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_notificationscontacts.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