Skip to content

tag_resource

tag_resource(
    arn: EmailContactArn,
    tags: TagMap,
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = 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/notifications_contacts.py
def tag_resource(
    self,
    arn: "capo_notificationscontacts.types.email_contact_arn.EmailContactArn",
    tags: "capo_notificationscontacts.types.tag_map.TagMap",
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = 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.
    """

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

        output, http_response = (
            capo_notificationscontacts._operations.notifications_contacts.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output