Adds tags to the specified resource. You can specify one or more tags to add.
Parameters:
-
resource_arn
(__string)
–
The Amazon Resource Name (ARN) for the resource. You can get this from the response to any request to the resource.
-
tags
(Optional[__mapOf__string], default:
None
)
–
A collection of tags associated with a resource
Raises:
Source code in docs_src/capo_mediapackage_vod/_services/media_package_vod.py
| def tag_resource(
self,
resource_arn: "capo_mediapackage_vod.types.__string.__string",
*,
config_overrides: Optional[MediaPackageVodClientConfig] = None,
tags: Optional[
"capo_mediapackage_vod.types.__map_of__string.__mapOf__string"
] = None,
) -> None:
"""Adds tags to the specified resource. You can specify one or more tags to add.
Args:
resource_arn: The Amazon Resource Name (ARN) for the resource. You can get this from the response to any request to the resource.
tags: A collection of tags associated with a resource
Raises:
capo_mediapackage_vod.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_mediapackage_vod.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[None]:
import capo_mediapackage_vod._operations.media_package_vod.tag_resource
output, http_response = (
capo_mediapackage_vod._operations.media_package_vod.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_mediapackage_vod.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn
}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|