Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automated regeneration of Vision client #10969

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ defmodule GoogleApi.Vision.V1.Api.Operations do
end

@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion clients/vision/lib/google_api/vision/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Vision.V1 do
API client metadata for GoogleApi.Vision.V1.
"""

@discovery_revision "20220915"
@discovery_revision "20240301"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ defmodule GoogleApi.Vision.V1.Model.AsyncBatchAnnotateFilesRequest do

## Attributes

* `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
* `parent` (*type:* `String.t`, *default:* `nil`) - 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`.
* `requests` (*type:* `list(GoogleApi.Vision.V1.Model.AsyncAnnotateFileRequest.t)`, *default:* `nil`) - Required. Individual async file annotation requests for this batch.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:labels => map() | nil,
:parent => String.t() | nil,
:requests => list(GoogleApi.Vision.V1.Model.AsyncAnnotateFileRequest.t()) | nil
}

field(:labels, type: :map)
field(:parent)
field(:requests, as: GoogleApi.Vision.V1.Model.AsyncAnnotateFileRequest, type: :list)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule GoogleApi.Vision.V1.Model.AsyncBatchAnnotateImagesRequest do

## Attributes

* `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
* `outputConfig` (*type:* `GoogleApi.Vision.V1.Model.OutputConfig.t`, *default:* `nil`) - Required. The desired output location and metadata (e.g. format).
* `parent` (*type:* `String.t`, *default:* `nil`) - 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`.
* `requests` (*type:* `list(GoogleApi.Vision.V1.Model.AnnotateImageRequest.t)`, *default:* `nil`) - Required. Individual image annotation requests for this batch.
Expand All @@ -29,11 +30,13 @@ defmodule GoogleApi.Vision.V1.Model.AsyncBatchAnnotateImagesRequest do
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:labels => map() | nil,
:outputConfig => GoogleApi.Vision.V1.Model.OutputConfig.t() | nil,
:parent => String.t() | nil,
:requests => list(GoogleApi.Vision.V1.Model.AnnotateImageRequest.t()) | nil
}

field(:labels, type: :map)
field(:outputConfig, as: GoogleApi.Vision.V1.Model.OutputConfig)
field(:parent)
field(:requests, as: GoogleApi.Vision.V1.Model.AnnotateImageRequest, type: :list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ defmodule GoogleApi.Vision.V1.Model.BatchAnnotateFilesRequest do

## Attributes

* `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
* `parent` (*type:* `String.t`, *default:* `nil`) - 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`.
* `requests` (*type:* `list(GoogleApi.Vision.V1.Model.AnnotateFileRequest.t)`, *default:* `nil`) - Required. The list of file annotation requests. Right now we support only one AnnotateFileRequest in BatchAnnotateFilesRequest.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:labels => map() | nil,
:parent => String.t() | nil,
:requests => list(GoogleApi.Vision.V1.Model.AnnotateFileRequest.t()) | nil
}

field(:labels, type: :map)
field(:parent)
field(:requests, as: GoogleApi.Vision.V1.Model.AnnotateFileRequest, type: :list)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ defmodule GoogleApi.Vision.V1.Model.BatchAnnotateImagesRequest do

## Attributes

* `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
* `parent` (*type:* `String.t`, *default:* `nil`) - 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`.
* `requests` (*type:* `list(GoogleApi.Vision.V1.Model.AnnotateImageRequest.t)`, *default:* `nil`) - Required. Individual image annotation requests for this batch.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:labels => map() | nil,
:parent => String.t() | nil,
:requests => list(GoogleApi.Vision.V1.Model.AnnotateImageRequest.t()) | nil
}

field(:labels, type: :map)
field(:parent)
field(:requests, as: GoogleApi.Vision.V1.Model.AnnotateImageRequest, type: :list)
end
Expand Down
2 changes: 1 addition & 1 deletion clients/vision/lib/google_api/vision/v1/model/color.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.Vision.V1.Model.Color do
@moduledoc """
Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...

## Attributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p1beta1SafeSearchAnnotati
* `medical` (*type:* `String.t`, *default:* `nil`) - Likelihood that this is a medical image.
* `racy` (*type:* `String.t`, *default:* `nil`) - Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
* `spoof` (*type:* `String.t`, *default:* `nil`) - Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content. Violent content may include death, serious harm, or injury to individuals or groups of individuals.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p2beta1SafeSearchAnnotati
* `medical` (*type:* `String.t`, *default:* `nil`) - Likelihood that this is a medical image.
* `racy` (*type:* `String.t`, *default:* `nil`) - Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
* `spoof` (*type:* `String.t`, *default:* `nil`) - Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content. Violent content may include death, serious harm, or injury to individuals or groups of individuals.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p3beta1SafeSearchAnnotati
* `medical` (*type:* `String.t`, *default:* `nil`) - Likelihood that this is a medical image.
* `racy` (*type:* `String.t`, *default:* `nil`) - Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
* `spoof` (*type:* `String.t`, *default:* `nil`) - Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content. Violent content may include death, serious harm, or injury to individuals or groups of individuals.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p4beta1SafeSearchAnnotati
* `medical` (*type:* `String.t`, *default:* `nil`) - Likelihood that this is a medical image.
* `racy` (*type:* `String.t`, *default:* `nil`) - Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
* `spoof` (*type:* `String.t`, *default:* `nil`) - Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content.
* `violence` (*type:* `String.t`, *default:* `nil`) - Likelihood that this image contains violent content. Violent content may include death, serious harm, or injury to individuals or groups of individuals.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Vision.V1.Model.Operation do
* `error` (*type:* `GoogleApi.Vision.V1.Model.Status.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation.
* `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
* `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
* `response` (*type:* `map()`, *default:* `nil`) - The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
* `response` (*type:* `map()`, *default:* `nil`) - The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Loading
Loading