Assigns tags to the specified retention rule.
Parameters:
-
resource_arn
(RuleArn)
–
The Amazon Resource Name (ARN) of the retention rule.
-
tags
(TagList)
–
Information about the tags to assign to the retention rule.
Raises:
Source code in docs_src/capo_rbin/_services/async_rbin.py
| async def tag_resource(
self,
resource_arn: "capo_rbin.types.rule_arn.RuleArn",
tags: "capo_rbin.types.tag_list.TagList",
*,
config_overrides: Optional[AsyncrbinClientConfig] = None,
) -> "capo_rbin.types.tag_resource_response.TagResourceResponse":
"""<p>Assigns tags to the specified retention rule.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the retention rule.</p>
tags: <p>Information about the tags to assign to the retention rule.</p>
Raises:
capo_rbin.errors.internal_server_exception.InternalServerException: <p>The service could not respond to the request due to an internal problem.</p>
capo_rbin.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_rbin.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota for the number of tags per resource to be exceeded.</p>
capo_rbin.errors.validation_exception.ValidationException: <p>One or more of the parameters in the request is not valid.</p>
capo_rbin.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_rbin.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_rbin.types.tag_resource_response.TagResourceResponse"
]:
import capo_rbin._operations.amazon_recycle_bin.tag_resource
(
output,
http_response,
) = await capo_rbin._operations.amazon_recycle_bin.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_rbin.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|