lib/google/cloud/vision/v1/image_annotator_client.rb in google-cloud-vision-0.34.0 vs lib/google/cloud/vision/v1/image_annotator_client.rb in google-cloud-vision-0.35.0

- old
+ new

@@ -190,26 +190,38 @@ ) @batch_annotate_images = Google::Gax.create_api_call( @image_annotator_stub.method(:batch_annotate_images), defaults["batch_annotate_images"], - exception_transformer: exception_transformer + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end ) @batch_annotate_files = Google::Gax.create_api_call( @image_annotator_stub.method(:batch_annotate_files), defaults["batch_annotate_files"], - exception_transformer: exception_transformer + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end ) @async_batch_annotate_images = Google::Gax.create_api_call( @image_annotator_stub.method(:async_batch_annotate_images), defaults["async_batch_annotate_images"], - exception_transformer: exception_transformer + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end ) @async_batch_annotate_files = Google::Gax.create_api_call( @image_annotator_stub.method(:async_batch_annotate_files), defaults["async_batch_annotate_files"], - exception_transformer: exception_transformer + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end ) end # Service calls @@ -217,10 +229,23 @@ # # @param requests [Array<Google::Cloud::Vision::V1::AnnotateImageRequest | Hash>] # Individual image annotation requests for this batch. # A hash of the same form as `Google::Cloud::Vision::V1::AnnotateImageRequest` # can also be provided. + # @param parent [String] + # 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`. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @yield [result, operation] Access the result along with the RPC operation # @yieldparam result [Google::Cloud::Vision::V1::BatchAnnotateImagesResponse] @@ -236,14 +261,16 @@ # requests = [] # response = image_annotator_client.batch_annotate_images(requests) def batch_annotate_images \ requests, + parent: nil, options: nil, &block req = { - requests: requests + requests: requests, + parent: parent }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Vision::V1::BatchAnnotateImagesRequest) @batch_annotate_images.call(req, options, &block) end @@ -258,10 +285,23 @@ # @param requests [Array<Google::Cloud::Vision::V1::AnnotateFileRequest | Hash>] # The list of file annotation requests. Right now we support only one # AnnotateFileRequest in BatchAnnotateFilesRequest. # A hash of the same form as `Google::Cloud::Vision::V1::AnnotateFileRequest` # can also be provided. + # @param parent [String] + # 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`. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @yield [result, operation] Access the result along with the RPC operation # @yieldparam result [Google::Cloud::Vision::V1::BatchAnnotateFilesResponse] @@ -277,14 +317,16 @@ # requests = [] # response = image_annotator_client.batch_annotate_files(requests) def batch_annotate_files \ requests, + parent: nil, options: nil, &block req = { - requests: requests + requests: requests, + parent: parent }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Vision::V1::BatchAnnotateFilesRequest) @batch_annotate_files.call(req, options, &block) end @@ -304,10 +346,23 @@ # can also be provided. # @param output_config [Google::Cloud::Vision::V1::OutputConfig | Hash] # Required. The desired output location and metadata (e.g. format). # A hash of the same form as `Google::Cloud::Vision::V1::OutputConfig` # can also be provided. + # @param parent [String] + # 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`. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @return [Google::Gax::Operation] # @raise [Google::Gax::GaxError] if the RPC is aborted. @@ -350,14 +405,16 @@ # operation.wait_until_done! def async_batch_annotate_images \ requests, output_config, + parent: nil, options: nil req = { requests: requests, - output_config: output_config + output_config: output_config, + parent: parent }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest) operation = Google::Gax::Operation.new( @async_batch_annotate_images.call(req, options), @operations_client, @@ -378,10 +435,23 @@ # # @param requests [Array<Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash>] # Individual async file annotation requests for this batch. # A hash of the same form as `Google::Cloud::Vision::V1::AsyncAnnotateFileRequest` # can also be provided. + # @param parent [String] + # 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`. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @return [Google::Gax::Operation] # @raise [Google::Gax::GaxError] if the RPC is aborted. @@ -420,12 +490,14 @@ # # completion. # operation.wait_until_done! def async_batch_annotate_files \ requests, + parent: nil, options: nil req = { - requests: requests + requests: requests, + parent: parent }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest) operation = Google::Gax::Operation.new( @async_batch_annotate_files.call(req, options), @operations_client,