Skip to content

tag_resource

tag_resource(
    resource_arn: Arn,
    tags: TagMap,
    *,
    config_overrides: Optional[MedicalImagingClientConfig] = None,
) -> TagResourceResponse

Adds a user-specifed key and value tag to a medical imaging resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the medical imaging resource that tags are being added to.

  • tags (TagMap) –

    The user-specified key and value tag pairs added to a medical imaging resource.

Raises:

Source code in docs_src/capo_medical_imaging/_services/medical_imaging.py
def tag_resource(
    self,
    resource_arn: "capo_medical_imaging.types.arn.Arn",
    tags: "capo_medical_imaging.types.tag_map.TagMap",
    *,
    config_overrides: Optional[MedicalImagingClientConfig] = None,
) -> "capo_medical_imaging.types.tag_resource_response.TagResourceResponse":
    """<p>Adds a user-specifed key and value tag to a medical imaging resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the medical imaging resource that tags are being added to.</p>
        tags: <p>The user-specified key and value tag pairs added to a medical imaging resource.</p>

    Raises:
        capo_medical_imaging.errors.access_denied_exception.AccessDeniedException: <p>The user does not have sufficient access to perform this action.</p>
        capo_medical_imaging.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during processing of the request.</p>
        capo_medical_imaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_medical_imaging.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling.</p>
        capo_medical_imaging.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints set by the service.</p>
        capo_medical_imaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_medical_imaging.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_medical_imaging.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_medical_imaging._operations.ahi_gateway_service.tag_resource

        output, http_response = (
            capo_medical_imaging._operations.ahi_gateway_service.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_medical_imaging.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