def tag_resource(
self,
resource_arn: "capo_schemas.types.__string.__string",
*,
config_overrides: Optional[schemasClientConfig] = None,
tags: Optional["capo_schemas.types.tags.Tags"] = None,
) -> None:
"""<p>Add tags to a resource.</p>
Args:
resource_arn: <p>The ARN of the resource.</p>
tags: <p>Tags associated with the resource.</p>
Raises:
capo_schemas.errors.bad_request_exception.BadRequestException
capo_schemas.errors.forbidden_exception.ForbiddenException
capo_schemas.errors.internal_server_error_exception.InternalServerErrorException
capo_schemas.errors.not_found_exception.NotFoundException
capo_schemas.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_schemas.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[None]:
import capo_schemas._operations.schemas.tag_resource
output, http_response = (
capo_schemas._operations.schemas.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_schemas.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