def tag_resource(
self,
resource_arn: "capo_license_manager_linux_subscriptions.types.subscription_provider_arn.SubscriptionProviderArn",
tags: "capo_license_manager_linux_subscriptions.types.tags.Tags",
*,
config_overrides: Optional[LicenseManagerLinuxSubscriptionsClientConfig] = None,
) -> "capo_license_manager_linux_subscriptions.types.tag_resource_response.TagResourceResponse":
"""<p>Add metadata tags to the specified Amazon Web Services resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the Amazon Web Services resource to which to add the specified metadata tags.</p>
tags: <p>The metadata tags to assign to the Amazon Web Services resource. Tags are formatted as key value pairs.</p>
Raises:
capo_license_manager_linux_subscriptions.errors.internal_server_exception.InternalServerException: <p>An exception occurred with the service.</p>
capo_license_manager_linux_subscriptions.errors.resource_not_found_exception.ResourceNotFoundException: <p>Unable to find the requested Amazon Web Services resource.</p>
capo_license_manager_linux_subscriptions.errors.validation_exception.ValidationException: <p>The provided input is not valid. Try your request again.</p>
capo_license_manager_linux_subscriptions.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_license_manager_linux_subscriptions.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_license_manager_linux_subscriptions.types.tag_resource_response.TagResourceResponse"
]:
import capo_license_manager_linux_subscriptions._operations.license_manager_linux_subscriptions.tag_resource
output, http_response = (
capo_license_manager_linux_subscriptions._operations.license_manager_linux_subscriptions.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_license_manager_linux_subscriptions.types.tag_resource_request.TagResourceRequest",
) -> dict[str, Any]:
import capo_license_manager_linux_subscriptions.types.tag_resource_request
return capo_license_manager_linux_subscriptions.types.tag_resource_request.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("TagResource", redact_input=_redact_input),
)
input_: capo_license_manager_linux_subscriptions.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output