Packages
Cloud Vision API client library. Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.
Current section
Files
Jump to
Current section
Files
lib/google_api/vision/v1/api/projects.ex
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This class is auto generated by the elixir code generator program.
# Do not edit the class manually.
defmodule GoogleApi.Vision.V1.Api.Projects do
@moduledoc """
API calls for all endpoints tagged `Projects`.
"""
alias GoogleApi.Vision.V1.Connection
alias GoogleApi.Gax.{Request, Response}
@library_version Mix.Project.config() |> Keyword.get(:version, "")
@doc """
Service that performs image detection and annotation for a batch of files.
Now only "application/pdf", "image/tiff" and "image/gif" are supported.
This service will extract at most 5 (customers can specify which 5 in
AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each
file provided and perform detection and annotation for each image
extracted.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.BatchAnnotateFilesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_files_annotate(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_files_annotate(connection, parent, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/files:annotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse{}])
end
@doc """
Run asynchronous image detection and annotation for a list of generic
files, such as PDF files, which may contain multiple pages and multiple
images per page. Progress and results can be retrieved through the
`google.longrunning.Operations` interface.
`Operation.metadata` contains `OperationMetadata` (metadata).
`Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.AsyncBatchAnnotateFilesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_files_async_batch_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_files_async_batch_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/files:asyncBatchAnnotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Run image detection and annotation for a batch of images.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.BatchAnnotateImagesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_images_annotate(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_images_annotate(connection, parent, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/images:annotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse{}])
end
@doc """
Run asynchronous image detection and annotation for a list of images.
Progress and results can be retrieved through the
`google.longrunning.Operations` interface.
`Operation.metadata` contains `OperationMetadata` (metadata).
`Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
This service will write image annotation outputs to json files in customer
GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.AsyncBatchAnnotateImagesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_images_async_batch_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_images_async_batch_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/images:asyncBatchAnnotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Service that performs image detection and annotation for a batch of files.
Now only "application/pdf", "image/tiff" and "image/gif" are supported.
This service will extract at most 5 (customers can specify which 5 in
AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each
file provided and perform detection and annotation for each image
extracted.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.BatchAnnotateFilesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_files_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_locations_files_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/files:annotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.BatchAnnotateFilesResponse{}])
end
@doc """
Run asynchronous image detection and annotation for a list of generic
files, such as PDF files, which may contain multiple pages and multiple
images per page. Progress and results can be retrieved through the
`google.longrunning.Operations` interface.
`Operation.metadata` contains `OperationMetadata` (metadata).
`Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.AsyncBatchAnnotateFilesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_files_async_batch_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_files_async_batch_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/files:asyncBatchAnnotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Run image detection and annotation for a batch of images.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.BatchAnnotateImagesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_images_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_locations_images_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/images:annotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.BatchAnnotateImagesResponse{}])
end
@doc """
Run asynchronous image detection and annotation for a list of images.
Progress and results can be retrieved through the
`google.longrunning.Operations` interface.
`Operation.metadata` contains `OperationMetadata` (metadata).
`Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
This service will write image annotation outputs to json files in customer
GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no parent is specified, a region will be chosen automatically.
Supported location-ids:
`us`: USA country only,
`asia`: East asia areas, like Japan, Taiwan,
`eu`: The European Union.
Example: `projects/project-A/locations/eu`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.AsyncBatchAnnotateImagesRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_images_async_batch_annotate(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_images_async_batch_annotate(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/images:asyncBatchAnnotate", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Gets the latest state of a long-running operation. Clients can use this
method to poll the operation result at intervals as recommended by the API
service.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The name of the operation resource.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_operations_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_operations_get(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Adds a Product to the specified ProductSet. If the Product is already
present, no change is made.
One Product can be added to at most 100 ProductSets.
Possible errors:
* Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name for the ProductSet to modify.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.AddProductToProductSetRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_add_product(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Empty.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_add_product(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+name}:addProduct", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Empty{}])
end
@doc """
Creates and returns a new ProductSet resource.
Possible errors:
* Returns INVALID_ARGUMENT if display_name is missing, or is longer than
4096 characters.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The project in which the ProductSet should be created.
Format is `projects/PROJECT_ID/locations/LOC_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:productSetId` (*type:* `String.t`) - A user-supplied resource id for this ProductSet. If set, the server will
attempt to use this value as the resource id. If it is already in use, an
error is returned with code ALREADY_EXISTS. Must be at most 128 characters
long. It cannot contain the character `/`.
* `:body` (*type:* `GoogleApi.Vision.V1.Model.ProductSet.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ProductSet{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_create(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ProductSet.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_create(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:productSetId => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/productSets", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ProductSet{}])
end
@doc """
Permanently deletes a ProductSet. Products and ReferenceImages in the
ProductSet are not deleted.
The actual image files are not deleted from Google Cloud Storage.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Resource name of the ProductSet to delete.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_delete(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Empty.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_delete(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:delete)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Empty{}])
end
@doc """
Gets information associated with a ProductSet.
Possible errors:
* Returns NOT_FOUND if the ProductSet does not exist.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Resource name of the ProductSet to get.
Format is:
`projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ProductSet{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ProductSet.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_get(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ProductSet{}])
end
@doc """
Asynchronous API that imports a list of reference images to specified
product sets based on a list of image information.
The google.longrunning.Operation API can be used to keep track of the
progress and results of the request.
`Operation.metadata` contains `BatchOperationMetadata`. (progress)
`Operation.response` contains `ImportProductSetsResponse`. (results)
The input source of this method is a csv file on Google Cloud Storage.
For the format of the csv file please see
ImportProductSetsGcsSource.csv_file_uri.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The project in which the ProductSets should be imported.
Format is `projects/PROJECT_ID/locations/LOC_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.ImportProductSetsRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_import(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_import(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/productSets:import", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
@doc """
Lists ProductSets in an unspecified order.
Possible errors:
* Returns INVALID_ARGUMENT if page_size is greater than 100, or less
than 1.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The project from which ProductSets should be listed.
Format is `projects/PROJECT_ID/locations/LOC_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:pageSize` (*type:* `integer()`) - The maximum number of items to return. Default 10, maximum 100.
* `:pageToken` (*type:* `String.t`) - The next_page_token returned from a previous List request, if any.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ListProductSetsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Vision.V1.Model.ListProductSetsResponse.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_list(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:pageSize => :query,
:pageToken => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/productSets", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ListProductSetsResponse{}])
end
@doc """
Makes changes to a ProductSet resource.
Only display_name can be updated currently.
Possible errors:
* Returns NOT_FOUND if the ProductSet does not exist.
* Returns INVALID_ARGUMENT if display_name is present in update_mask but
missing from the request or longer than 4096 characters.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name of the ProductSet.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
This field is ignored when creating a ProductSet.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:updateMask` (*type:* `String.t`) - The FieldMask that specifies which fields to
update.
If update_mask isn't specified, all mutable fields are to be updated.
Valid mask path is `display_name`.
* `:body` (*type:* `GoogleApi.Vision.V1.Model.ProductSet.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ProductSet{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_patch(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ProductSet.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_patch(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:updateMask => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:patch)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ProductSet{}])
end
@doc """
Removes a Product from the specified ProductSet.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name for the ProductSet to modify.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.Vision.V1.Model.RemoveProductFromProductSetRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_remove_product(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Empty.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_remove_product(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+name}:removeProduct", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Empty{}])
end
@doc """
Lists the Products in a ProductSet, in an unspecified order. If the
ProductSet does not exist, the products field of the response will be
empty.
Possible errors:
* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The ProductSet resource for which to retrieve Products.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:pageSize` (*type:* `integer()`) - The maximum number of items to return. Default 10, maximum 100.
* `:pageToken` (*type:* `String.t`) - The next_page_token returned from a previous List request, if any.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ListProductsInProductSetResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_product_sets_products_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Vision.V1.Model.ListProductsInProductSetResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_locations_product_sets_products_list(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:pageSize => :query,
:pageToken => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}/products", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.Vision.V1.Model.ListProductsInProductSetResponse{}]
)
end
@doc """
Creates and returns a new product resource.
Possible errors:
* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
characters.
* Returns INVALID_ARGUMENT if description is longer than 4096 characters.
* Returns INVALID_ARGUMENT if product_category is missing or invalid.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The project in which the Product should be created.
Format is
`projects/PROJECT_ID/locations/LOC_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:productId` (*type:* `String.t`) - A user-supplied resource id for this Product. If set, the server will
attempt to use this value as the resource id. If it is already in use, an
error is returned with code ALREADY_EXISTS. Must be at most 128 characters
long. It cannot contain the character `/`.
* `:body` (*type:* `GoogleApi.Vision.V1.Model.Product.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Product{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_create(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Product.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_create(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:productId => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/products", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Product{}])
end
@doc """
Permanently deletes a product and its reference images.
Metadata of the product and all its images will be deleted right away, but
search queries against ProductSets containing the product may still work
until all related caches are refreshed.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Resource name of product to delete.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_delete(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Empty.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_delete(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:delete)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Empty{}])
end
@doc """
Gets information associated with a Product.
Possible errors:
* Returns NOT_FOUND if the Product does not exist.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Resource name of the Product to get.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Product{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Product.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_get(connection, name, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Product{}])
end
@doc """
Lists products in an unspecified order.
Possible errors:
* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The project OR ProductSet from which Products should be listed.
Format:
`projects/PROJECT_ID/locations/LOC_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:pageSize` (*type:* `integer()`) - The maximum number of items to return. Default 10, maximum 100.
* `:pageToken` (*type:* `String.t`) - The next_page_token returned from a previous List request, if any.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ListProductsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ListProductsResponse.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_list(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:pageSize => :query,
:pageToken => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/products", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ListProductsResponse{}])
end
@doc """
Makes changes to a Product resource.
Only the `display_name`, `description`, and `labels` fields can be updated
right now.
If labels are updated, the change will not be reflected in queries until
the next index time.
Possible errors:
* Returns NOT_FOUND if the Product does not exist.
* Returns INVALID_ARGUMENT if display_name is present in update_mask but is
missing from the request or longer than 4096 characters.
* Returns INVALID_ARGUMENT if description is present in update_mask but is
longer than 4096 characters.
* Returns INVALID_ARGUMENT if product_category is present in update_mask.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name of the product.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
This field is ignored when creating a product.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:updateMask` (*type:* `String.t`) - The FieldMask that specifies which fields
to update.
If update_mask isn't specified, all mutable fields are to be updated.
Valid mask paths include `product_labels`, `display_name`, and
`description`.
* `:body` (*type:* `GoogleApi.Vision.V1.Model.Product.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Product{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_patch(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Product.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_patch(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:updateMask => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:patch)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Product{}])
end
@doc """
Creates and returns a new ReferenceImage resource.
The `bounding_poly` field is optional. If `bounding_poly` is not specified,
the system will try to detect regions of interest in the image that are
compatible with the product_category on the parent product. If it is
specified, detection is ALWAYS skipped. The system converts polygons into
non-rotated rectangles.
Note that the pipeline will resize the image if the image resolution is too
large to process (above 50MP).
Possible errors:
* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
characters.
* Returns INVALID_ARGUMENT if the product does not exist.
* Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
compatible with the parent product's product_category is detected.
* Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Resource name of the product in which to create the reference image.
Format is
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:referenceImageId` (*type:* `String.t`) - A user-supplied resource id for the ReferenceImage to be added. If set,
the server will attempt to use this value as the resource id. If it is
already in use, an error is returned with code ALREADY_EXISTS. Must be at
most 128 characters long. It cannot contain the character `/`.
* `:body` (*type:* `GoogleApi.Vision.V1.Model.ReferenceImage.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ReferenceImage{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_reference_images_create(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ReferenceImage.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_reference_images_create(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:referenceImageId => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/referenceImages", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ReferenceImage{}])
end
@doc """
Permanently deletes a reference image.
The image metadata will be deleted right away, but search queries
against ProductSets containing the image may still work until all related
caches are refreshed.
The actual image files are not deleted from Google Cloud Storage.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name of the reference image to delete.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_reference_images_delete(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.Empty.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_reference_images_delete(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:delete)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Empty{}])
end
@doc """
Gets information associated with a ReferenceImage.
Possible errors:
* Returns NOT_FOUND if the specified image does not exist.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The resource name of the ReferenceImage to get.
Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ReferenceImage{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_reference_images_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.Vision.V1.Model.ReferenceImage.t()} | {:error, Tesla.Env.t()}
def vision_projects_locations_products_reference_images_get(
connection,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ReferenceImage{}])
end
@doc """
Lists reference images.
Possible errors:
* Returns NOT_FOUND if the parent product does not exist.
* Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
than 1.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Resource name of the product containing the reference images.
Format is
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:pageSize` (*type:* `integer()`) - The maximum number of items to return. Default 10, maximum 100.
* `:pageToken` (*type:* `String.t`) - A token identifying a page of results to be returned. This is the value
of `nextPageToken` returned in a previous reference image list request.
Defaults to the first page if not specified.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.ListReferenceImagesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_locations_products_reference_images_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Vision.V1.Model.ListReferenceImagesResponse.t()}
| {:error, Tesla.Env.t()}
def vision_projects_locations_products_reference_images_list(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:pageSize => :query,
:pageToken => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/referenceImages", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.ListReferenceImagesResponse{}])
end
@doc """
Gets the latest state of a long-running operation. Clients can use this
method to poll the operation result at intervals as recommended by the API
service.
## Parameters
* `connection` (*type:* `GoogleApi.Vision.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The name of the operation resource.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Vision.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec vision_projects_operations_get(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Vision.V1.Model.Operation.t()} | {:error, Tesla.Env.t()}
def vision_projects_operations_get(connection, name, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)
connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Vision.V1.Model.Operation{}])
end
end