Packages

Google Cloud Vision API client library.

Current section

Files

Jump to
googly_cloud_vision lib googly cloud_vision model grouped_result.ex
Raw

lib/googly/cloud_vision/model/grouped_result.ex

# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.GroupedResult do
@moduledoc """
Information about the products similar to a single product in a query image.
## Attributes
* `bounding_poly` (*type:* `Googly.CloudVision.Model.BoundingPoly.t()`) - The bounding polygon around the product detected in the query image.
* `object_annotations` (*type:* `list(Googly.CloudVision.Model.ObjectAnnotation.t())`) - List of generic predictions for the object in the bounding box.
* `results` (*type:* `list(Googly.CloudVision.Model.Result.t())`) - List of results, one for each product match.
"""
defstruct [:bounding_poly, :object_annotations, :results]
@type t :: %__MODULE__{
bounding_poly: Googly.CloudVision.Model.BoundingPoly.t() | nil,
object_annotations: list(Googly.CloudVision.Model.ObjectAnnotation.t()) | nil,
results: list(Googly.CloudVision.Model.Result.t()) | nil
}
@wire %{bounding_poly: "boundingPoly", object_annotations: "objectAnnotations"}
@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__{
bounding_poly: Googly.CloudVision.Model.BoundingPoly.decode(m["boundingPoly"]),
object_annotations:
Googly.CloudVision.Model.ObjectAnnotation.decode(m["objectAnnotations"]),
results: Googly.CloudVision.Model.Result.decode(m["results"])
}
end
end