Skip to content

tag_contact

tag_contact(
    contact_id: ContactId,
    instance_id: InstanceId,
    tags: ContactTagMap,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
) -> TagContactResponse

Adds the specified tags to the contact resource. For more information about this API is used, see Set up granular billing for a detailed view of your Connect Customer usage.

Parameters:

  • contact_id (ContactId) –

    The identifier of the contact in this instance of Connect Customer.

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • tags (ContactTagMap) –

    The tags to be assigned to the contact resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

    Authorization is not supported by this tag.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def tag_contact(
    self,
    contact_id: "capo_connect.types.contact_id.ContactId",
    instance_id: "capo_connect.types.instance_id.InstanceId",
    tags: "capo_connect.types.contact_tag_map.ContactTagMap",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
) -> "capo_connect.types.tag_contact_response.TagContactResponse":
    """<p>Adds the specified tags to the contact resource. For more information about this API is used, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/granular-billing.html">Set up granular billing for a detailed view of your Connect Customer usage</a>. </p>

    Args:
        contact_id: <p>The identifier of the contact in this instance of Connect Customer. </p>
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        tags: <p>The tags to be assigned to the contact resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p> <note> <p>Authorization is not supported by this tag.</p> </note>

    Raises:
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_active_region_exception.InvalidActiveRegionException: <p>This exception occurs when an API request is made to a non-active region in an Amazon Connect instance configured with Amazon Connect Global Resiliency. For example, if the active region is US West (Oregon) and a request is made to US East (N. Virginia), the exception will be returned.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.tag_contact_request.TagContactRequest]",
    ) -> OperationResponse[
        "capo_connect.types.tag_contact_response.TagContactResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.tag_contact

        output, http_response = (
            capo_connect._operations.amazon_connect_service.tag_contact.tag_contact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagContact")
    )
    input_: capo_connect.types.tag_contact_request.TagContactRequest = {
        "contact_id": contact_id,
        "instance_id": instance_id,
        "tags": tags,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output