def add_tags(
self,
tags: "capo_machine_learning.types.tag_list.TagList",
resource_id: "capo_machine_learning.types.entity_id.EntityId",
resource_type: "capo_machine_learning.types.taggable_resource_type.TaggableResourceType",
*,
config_overrides: Optional[MachineLearningClientConfig] = None,
) -> "capo_machine_learning.types.add_tags_output.AddTagsOutput":
"""<p>Adds one or more tags to an object, up to a limit of 10. Each tag consists of a key and an optional value. If you add a tag using a key that is already associated with the ML object, <code>AddTags</code> updates the tag's value.</p>
Args:
tags: <p>The key-value pairs to use to create tags. If you specify a key without specifying a value, Amazon ML creates a tag with the specified key and a value of null.</p>
resource_id: <p>The ID of the ML object to tag. For example, <code>exampleModelId</code>.</p>
resource_type: <p>The type of the ML object to tag.</p>
Raises:
capo_machine_learning.errors.internal_server_exception.InternalServerException: <p>An error on the server occurred when trying to process a request.</p>
capo_machine_learning.errors.invalid_input_exception.InvalidInputException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
capo_machine_learning.errors.invalid_tag_exception.InvalidTagException
capo_machine_learning.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource cannot be located.</p>
capo_machine_learning.errors.tag_limit_exceeded_exception.TagLimitExceededException
capo_machine_learning.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_machine_learning.types.add_tags_input.AddTagsInput]",
) -> OperationResponse[
"capo_machine_learning.types.add_tags_output.AddTagsOutput"
]:
import capo_machine_learning._operations.amazon_ml_20141212.add_tags
output, http_response = (
capo_machine_learning._operations.amazon_ml_20141212.add_tags.add_tags(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddTags")
)
input_: capo_machine_learning.types.add_tags_input.AddTagsInput = {
"tags": tags,
"resource_id": resource_id,
"resource_type": resource_type,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output