Current section
Files
Jump to
Current section
Files
lib/googly/cloud_vision/model/annotate_image_response.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.AnnotateImageResponse do
@moduledoc """
Response to an image annotation request.
## Attributes
* `context` (*type:* `Googly.CloudVision.Model.ImageAnnotationContext.t()`) - If present, contextual information is needed to understand where this image comes from.
* `crop_hints_annotation` (*type:* `Googly.CloudVision.Model.CropHintsAnnotation.t()`) - If present, crop hints have completed successfully.
* `error` (*type:* `Googly.CloudVision.Model.Status.t()`) - If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set.
* `face_annotations` (*type:* `list(Googly.CloudVision.Model.FaceAnnotation.t())`) - If present, face detection has completed successfully.
* `full_text_annotation` (*type:* `Googly.CloudVision.Model.TextAnnotation.t()`) - If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text.
* `image_properties_annotation` (*type:* `Googly.CloudVision.Model.ImageProperties.t()`) - If present, image properties were extracted successfully.
* `label_annotations` (*type:* `list(Googly.CloudVision.Model.EntityAnnotation.t())`) - If present, label detection has completed successfully.
* `landmark_annotations` (*type:* `list(Googly.CloudVision.Model.EntityAnnotation.t())`) - If present, landmark detection has completed successfully.
* `localized_object_annotations` (*type:* `list(Googly.CloudVision.Model.LocalizedObjectAnnotation.t())`) - If present, localized object detection has completed successfully. This will be sorted descending by confidence score.
* `logo_annotations` (*type:* `list(Googly.CloudVision.Model.EntityAnnotation.t())`) - If present, logo detection has completed successfully.
* `product_search_results` (*type:* `Googly.CloudVision.Model.ProductSearchResults.t()`) - If present, product search has completed successfully.
* `safe_search_annotation` (*type:* `Googly.CloudVision.Model.SafeSearchAnnotation.t()`) - If present, safe-search annotation has completed successfully.
* `text_annotations` (*type:* `list(Googly.CloudVision.Model.EntityAnnotation.t())`) - If present, text (OCR) detection has completed successfully.
* `web_detection` (*type:* `Googly.CloudVision.Model.WebDetection.t()`) - If present, web detection has completed successfully.
"""
defstruct [
:context,
:crop_hints_annotation,
:error,
:face_annotations,
:full_text_annotation,
:image_properties_annotation,
:label_annotations,
:landmark_annotations,
:localized_object_annotations,
:logo_annotations,
:product_search_results,
:safe_search_annotation,
:text_annotations,
:web_detection
]
@type t :: %__MODULE__{
context: Googly.CloudVision.Model.ImageAnnotationContext.t() | nil,
crop_hints_annotation: Googly.CloudVision.Model.CropHintsAnnotation.t() | nil,
error: Googly.CloudVision.Model.Status.t() | nil,
face_annotations: list(Googly.CloudVision.Model.FaceAnnotation.t()) | nil,
full_text_annotation: Googly.CloudVision.Model.TextAnnotation.t() | nil,
image_properties_annotation: Googly.CloudVision.Model.ImageProperties.t() | nil,
label_annotations: list(Googly.CloudVision.Model.EntityAnnotation.t()) | nil,
landmark_annotations: list(Googly.CloudVision.Model.EntityAnnotation.t()) | nil,
localized_object_annotations:
list(Googly.CloudVision.Model.LocalizedObjectAnnotation.t()) | nil,
logo_annotations: list(Googly.CloudVision.Model.EntityAnnotation.t()) | nil,
product_search_results: Googly.CloudVision.Model.ProductSearchResults.t() | nil,
safe_search_annotation: Googly.CloudVision.Model.SafeSearchAnnotation.t() | nil,
text_annotations: list(Googly.CloudVision.Model.EntityAnnotation.t()) | nil,
web_detection: Googly.CloudVision.Model.WebDetection.t() | nil
}
@wire %{
crop_hints_annotation: "cropHintsAnnotation",
face_annotations: "faceAnnotations",
full_text_annotation: "fullTextAnnotation",
image_properties_annotation: "imagePropertiesAnnotation",
label_annotations: "labelAnnotations",
landmark_annotations: "landmarkAnnotations",
localized_object_annotations: "localizedObjectAnnotations",
logo_annotations: "logoAnnotations",
product_search_results: "productSearchResults",
safe_search_annotation: "safeSearchAnnotation",
text_annotations: "textAnnotations",
web_detection: "webDetection"
}
@doc false
def __wire__, do: @wire
@doc false
def decode(nil), do: nil
def decode(list) when is_list(list), do: Enum.map(list, &decode/1)
def decode(m) do
%__MODULE__{
context: Googly.CloudVision.Model.ImageAnnotationContext.decode(m["context"]),
crop_hints_annotation:
Googly.CloudVision.Model.CropHintsAnnotation.decode(m["cropHintsAnnotation"]),
error: Googly.CloudVision.Model.Status.decode(m["error"]),
face_annotations: Googly.CloudVision.Model.FaceAnnotation.decode(m["faceAnnotations"]),
full_text_annotation:
Googly.CloudVision.Model.TextAnnotation.decode(m["fullTextAnnotation"]),
image_properties_annotation:
Googly.CloudVision.Model.ImageProperties.decode(m["imagePropertiesAnnotation"]),
label_annotations: Googly.CloudVision.Model.EntityAnnotation.decode(m["labelAnnotations"]),
landmark_annotations:
Googly.CloudVision.Model.EntityAnnotation.decode(m["landmarkAnnotations"]),
localized_object_annotations:
Googly.CloudVision.Model.LocalizedObjectAnnotation.decode(m["localizedObjectAnnotations"]),
logo_annotations: Googly.CloudVision.Model.EntityAnnotation.decode(m["logoAnnotations"]),
product_search_results:
Googly.CloudVision.Model.ProductSearchResults.decode(m["productSearchResults"]),
safe_search_annotation:
Googly.CloudVision.Model.SafeSearchAnnotation.decode(m["safeSearchAnnotation"]),
text_annotations: Googly.CloudVision.Model.EntityAnnotation.decode(m["textAnnotations"]),
web_detection: Googly.CloudVision.Model.WebDetection.decode(m["webDetection"])
}
end
end