Skip to content

untag_resource

untag_resource(
    resource_arn: str,
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    tag_keys: Optional[__listOfString] = None,
) -> None

Deletes specified tags from a resource in the current region.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) of the resource that you want to untag.

  • tag_keys (Optional[__listOfString], default: None ) –

    The keys of the tags to be removed.

Raises:

  • BadRequestException –

    This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message.

  • InternalServerErrorException –

    The server encountered an internal error and is unable to complete the request.

  • NotFoundException –

    One or more of the resources in the request does not exist in the system.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mediaconnect/_services/media_connect.py
def untag_resource(
    self,
    resource_arn: str,
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    tag_keys: Optional[
        "capo_mediaconnect.types.__list_of_string.__listOfString"
    ] = None,
) -> None:
    """<p> Deletes specified tags from a resource in the current region.</p>

    Args:
        resource_arn: <p> The Amazon Resource Name (ARN) of the resource that you want to untag. </p>
        tag_keys: <p>The keys of the tags to be removed. </p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.not_found_exception.NotFoundException: <p>One or more of the resources in the request does not exist in the system. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediaconnect.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[None]:
        import capo_mediaconnect._operations.media_connect.untag_resource

        output, http_response = (
            capo_mediaconnect._operations.media_connect.untag_resource.untag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_mediaconnect.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn
    }
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys

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