async def tag_resource(
self,
resource_arn: "capo_mgn.types.arn.ARN",
tags: "capo_mgn.types.tags_map.TagsMap",
*,
config_overrides: Optional[AsyncmgnClientConfig] = None,
) -> None:
"""<p>Adds or overwrites only the specified tags for the specified Application Migration Service resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value.</p>
Args:
resource_arn: <p>Tag resource by ARN.</p>
tags: <p>Tag resource by Tags.</p>
Raises:
capo_mgn.errors.access_denied_exception.AccessDeniedException: <p>Operation denied due to a file permission or access check error.</p>
capo_mgn.errors.internal_server_exception.InternalServerException: <p>The server encountered an unexpected condition that prevented it from fulfilling the request.</p>
capo_mgn.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found exception.</p>
capo_mgn.errors.throttling_exception.ThrottlingException: <p>Reached throttling quota exception.</p>
capo_mgn.errors.validation_exception.ValidationException: <p>Validate exception.</p>
capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_mgn.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[None]:
import capo_mgn._operations.application_migration_service.tag_resource
(
output,
http_response,
) = await capo_mgn._operations.application_migration_service.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_mgn.types.tag_resource_request.TagResourceRequest",
) -> dict[str, Any]:
import capo_mgn.types.tag_resource_request
return capo_mgn.types.tag_resource_request.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("TagResource", redact_input=_redact_input),
)
input_: capo_mgn.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