Tags the resource with a tag key and value.
Parameters:
-
resource_arn
(str)
–
The Amazon Resource Name (ARN) to use to tag a resource.
-
tags
(Tags)
–
A list of tag key value pairs for a specified Amazon Resource Name (ARN).
Raises:
Source code in docs_src/capo_amplifyuibuilder/_services/async_amplify_ui_builder.py
| async def tag_resource(
self,
resource_arn: str,
tags: "capo_amplifyuibuilder.types.tags.Tags",
*,
config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
) -> "capo_amplifyuibuilder.types.tag_resource_response.TagResourceResponse":
"""<p>Tags the resource with a tag key and value.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) to use to tag a resource.</p>
tags: <p>A list of tag key value pairs for a specified Amazon Resource Name (ARN).</p>
Raises:
capo_amplifyuibuilder.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred. Please retry your request.</p>
capo_amplifyuibuilder.errors.invalid_parameter_exception.InvalidParameterException: <p>An invalid or out-of-range value was supplied for the input parameter.</p>
capo_amplifyuibuilder.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
capo_amplifyuibuilder.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_amplifyuibuilder.errors.unauthorized_exception.UnauthorizedException: <p>You don't have permission to perform this operation.</p>
capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_amplifyuibuilder.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_amplifyuibuilder.types.tag_resource_response.TagResourceResponse"
]:
import capo_amplifyuibuilder._operations.amplify_ui_builder.tag_resource
(
output,
http_response,
) = await capo_amplifyuibuilder._operations.amplify_ui_builder.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_amplifyuibuilder.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
|