Packages

Google Cloud Vision API client library.

Current section

Files

Jump to
googly_cloud_vision lib googly cloud_vision model annotate_file_response.ex
Raw

lib/googly/cloud_vision/model/annotate_file_response.ex

# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudVision.Model.AnnotateFileResponse do
@moduledoc """
Response to a single file annotation request. A file may contain one or more images, which individually have their own responses.
## Attributes
* `error` (*type:* `Googly.CloudVision.Model.Status.t()`) - If set, represents the error message for the failed request. The `responses` field will not be set in this case.
* `input_config` (*type:* `Googly.CloudVision.Model.InputConfig.t()`) - Information about the file for which this response is generated.
* `responses` (*type:* `list(Googly.CloudVision.Model.AnnotateImageResponse.t())`) - Individual responses to images found within the file. This field will be empty if the `error` field is set.
* `total_pages` (*type:* `integer()`) - This field gives the total number of pages in the file.
"""
defstruct [:error, :input_config, :responses, :total_pages]
@type t :: %__MODULE__{
error: Googly.CloudVision.Model.Status.t() | nil,
input_config: Googly.CloudVision.Model.InputConfig.t() | nil,
responses: list(Googly.CloudVision.Model.AnnotateImageResponse.t()) | nil,
total_pages: integer() | nil
}
@wire %{input_config: "inputConfig", total_pages: "totalPages"}
@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__{
error: Googly.CloudVision.Model.Status.decode(m["error"]),
input_config: Googly.CloudVision.Model.InputConfig.decode(m["inputConfig"]),
responses: Googly.CloudVision.Model.AnnotateImageResponse.decode(m["responses"]),
total_pages: m["totalPages"]
}
end
end