Skip to content

tag_resource

tag_resource(
    resource_arn: ResourceARN,
    tags: TagList,
    *,
    config_overrides: Optional[PartnerCentralRevenueMeasurementClientConfig] = None,
) -> None

Adds or overwrites one or more tags for the specified resource.

Parameters:

  • resource_arn (ResourceARN) –

    The Amazon Resource Name (ARN) of the resource to tag.

  • tags (TagList) –

    The tags to add to the resource.

Raises:

Source code in docs_src/capo_partnercentral_revenue_measurement/_services/partner_central_revenue_measurement.py
def tag_resource(
    self,
    resource_arn: "capo_partnercentral_revenue_measurement.types.resource_arn.ResourceARN",
    tags: "capo_partnercentral_revenue_measurement.types.tag_list.TagList",
    *,
    config_overrides: Optional[PartnerCentralRevenueMeasurementClientConfig] = None,
) -> None:
    """<p>Adds or overwrites one or more tags for the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to tag.</p>
        tags: <p>The tags to add to the resource.</p>

    Raises:
        capo_partnercentral_revenue_measurement.errors.access_denied_exception.AccessDeniedException: <p>The request was denied due to insufficient permissions.</p>
        capo_partnercentral_revenue_measurement.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_partnercentral_revenue_measurement.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_partnercentral_revenue_measurement.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_partnercentral_revenue_measurement.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Retry your request.</p>
        capo_partnercentral_revenue_measurement.errors.validation_exception.ValidationException: <p>The request failed validation due to invalid input parameters.</p>
        capo_partnercentral_revenue_measurement.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_revenue_measurement.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[None]:
        import capo_partnercentral_revenue_measurement._operations.partner_central_revenue_measurement.tag_resource

        output, http_response = (
            capo_partnercentral_revenue_measurement._operations.partner_central_revenue_measurement.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_partnercentral_revenue_measurement.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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