Class: Google::Cloud::AutoML::V1::AutoML::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/automl/v1/automl/rest/client.rb

Overview

REST client for the AutoMl service.

AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

Currently the only supported location_id is "us-central1".

On any input that is documented to expect a string parameter in snake_case or dash-case, either of those cases is accepted.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#annotation_spec_path, #dataset_path, #location_path, #model_evaluation_path, #model_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new AutoMl REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the AutoMl client.

Yield Parameters:



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 202

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @auto_ml_stub = ::Google::Cloud::AutoML::V1::AutoML::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::AutoML::V1::AutoML::Rest::Operations (readonly)

Get the associated client for long-running operations.



245
246
247
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 245

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the AutoMl Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all AutoMl clients
::Google::Cloud::AutoML::V1::AutoML::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 77

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "AutoML", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_dataset.timeout = 5.0

    default_config.rpcs.get_dataset.timeout = 5.0
    default_config.rpcs.get_dataset.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_datasets.timeout = 5.0
    default_config.rpcs.list_datasets.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.update_dataset.timeout = 5.0

    default_config.rpcs.delete_dataset.timeout = 5.0
    default_config.rpcs.delete_dataset.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.import_data.timeout = 5.0

    default_config.rpcs.export_data.timeout = 5.0

    default_config.rpcs.get_annotation_spec.timeout = 5.0
    default_config.rpcs.get_annotation_spec.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.create_model.timeout = 5.0

    default_config.rpcs.get_model.timeout = 5.0
    default_config.rpcs.get_model.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_models.timeout = 5.0
    default_config.rpcs.list_models.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.delete_model.timeout = 5.0
    default_config.rpcs.delete_model.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.update_model.timeout = 5.0

    default_config.rpcs.deploy_model.timeout = 5.0

    default_config.rpcs.undeploy_model.timeout = 5.0

    default_config.rpcs.export_model.timeout = 5.0

    default_config.rpcs.get_model_evaluation.timeout = 5.0
    default_config.rpcs.get_model_evaluation.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_model_evaluations.timeout = 5.0
    default_config.rpcs.list_model_evaluations.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the AutoMl Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



172
173
174
175
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 172

def configure
  yield @config if block_given?
  @config
end

#create_dataset(request, options = nil) ⇒ ::Gapic::Operation #create_dataset(parent: nil, dataset: nil) ⇒ ::Gapic::Operation

Creates a dataset.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new

# Call the create_dataset method.
result = client.create_dataset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_dataset(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_dataset via a request object, either of type CreateDatasetRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::CreateDatasetRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_dataset(parent: nil, dataset: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_dataset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the project to create the dataset for.

    • dataset (::Google::Cloud::AutoML::V1::Dataset, ::Hash) (defaults to: nil)

      Required. The dataset to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 301

def create_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_dataset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.create_dataset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_model(request, options = nil) ⇒ ::Gapic::Operation #create_model(parent: nil, model: nil) ⇒ ::Gapic::Operation

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::CreateModelRequest.new

# Call the create_model method.
result = client.create_model request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_model(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_model via a request object, either of type CreateModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::CreateModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_model(parent: nil, model: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the parent project where the model is being created.

    • model (::Google::Cloud::AutoML::V1::Model, ::Hash) (defaults to: nil)

      Required. The model to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1014

def create_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::CreateModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.create_model request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_dataset(request, options = nil) ⇒ ::Gapic::Operation #delete_dataset(name: nil) ⇒ ::Gapic::Operation

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new

# Call the delete_dataset method.
result = client.delete_dataset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_dataset(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_dataset via a request object, either of type DeleteDatasetRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::DeleteDatasetRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_dataset(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_dataset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the dataset to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 652

def delete_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_dataset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.delete_dataset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_model(request, options = nil) ⇒ ::Gapic::Operation #delete_model(name: nil) ⇒ ::Gapic::Operation

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::DeleteModelRequest.new

# Call the delete_model method.
result = client.delete_model request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_model(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_model via a request object, either of type DeleteModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::DeleteModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_model(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the model being deleted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1285

def delete_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeleteModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.delete_model request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#deploy_model(request, options = nil) ⇒ ::Gapic::Operation #deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) ⇒ ::Gapic::Operation

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::DeployModelRequest.new

# Call the deploy_model method.
result = client.deploy_model request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #deploy_model(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to deploy_model via a request object, either of type DeployModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::DeployModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) ⇒ ::Gapic::Operation

    Pass arguments to deploy_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1467

def deploy_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::DeployModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.deploy_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.deploy_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.deploy_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.deploy_model request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_data(request, options = nil) ⇒ ::Gapic::Operation #export_data(name: nil, output_config: nil) ⇒ ::Gapic::Operation

Exports dataset's data to the provided output location. Returns an empty response in the response field when it completes.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ExportDataRequest.new

# Call the export_data method.
result = client.export_data request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #export_data(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to export_data via a request object, either of type ExportDataRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ExportDataRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #export_data(name: nil, output_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to export_data via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the dataset.

    • output_config (::Google::Cloud::AutoML::V1::OutputConfig, ::Hash) (defaults to: nil)

      Required. The desired output location.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 842

def export_data request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportDataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.export_data..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.export_data.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.export_data.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.export_data request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_model(request, options = nil) ⇒ ::Gapic::Operation #export_model(name: nil, output_config: nil) ⇒ ::Gapic::Operation

Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in ModelExportOutputConfig.

Returns an empty response in the response field when it completes.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ExportModelRequest.new

# Call the export_model method.
result = client.export_model request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #export_model(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to export_model via a request object, either of type ExportModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ExportModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #export_model(name: nil, output_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to export_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1655

def export_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ExportModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.export_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.export_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.export_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.export_model request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_annotation_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::AnnotationSpec #get_annotation_spec(name: nil) ⇒ ::Google::Cloud::AutoML::V1::AnnotationSpec

Gets an annotation spec.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new

# Call the get_annotation_spec method.
result = client.get_annotation_spec request

# The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec.
p result

Overloads:

  • #get_annotation_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::AnnotationSpec

    Pass arguments to get_annotation_spec via a request object, either of type GetAnnotationSpecRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_annotation_spec(name: nil) ⇒ ::Google::Cloud::AutoML::V1::AnnotationSpec

    Pass arguments to get_annotation_spec via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the annotation spec to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 922

def get_annotation_spec request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetAnnotationSpecRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_annotation_spec..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_annotation_spec.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_annotation_spec.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.get_annotation_spec request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset #get_dataset(name: nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

Gets a dataset.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::GetDatasetRequest.new

# Call the get_dataset method.
result = client.get_dataset request

# The returned object is of type Google::Cloud::AutoML::V1::Dataset.
p result

Overloads:

  • #get_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

    Pass arguments to get_dataset via a request object, either of type GetDatasetRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::GetDatasetRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_dataset(name: nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

    Pass arguments to get_dataset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the dataset to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 381

def get_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_dataset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.get_dataset request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_model(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Model #get_model(name: nil) ⇒ ::Google::Cloud::AutoML::V1::Model

Gets a model.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::GetModelRequest.new

# Call the get_model method.
result = client.get_model request

# The returned object is of type Google::Cloud::AutoML::V1::Model.
p result

Overloads:

  • #get_model(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Model

    Pass arguments to get_model via a request object, either of type GetModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::GetModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_model(name: nil) ⇒ ::Google::Cloud::AutoML::V1::Model

    Pass arguments to get_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the model.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1094

def get_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.get_model request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_model_evaluation(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::ModelEvaluation #get_model_evaluation(name: nil) ⇒ ::Google::Cloud::AutoML::V1::ModelEvaluation

Gets a model evaluation.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new

# Call the get_model_evaluation method.
result = client.get_model_evaluation request

# The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation.
p result

Overloads:

  • #get_model_evaluation(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::ModelEvaluation

    Pass arguments to get_model_evaluation via a request object, either of type GetModelEvaluationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::GetModelEvaluationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_model_evaluation(name: nil) ⇒ ::Google::Cloud::AutoML::V1::ModelEvaluation

    Pass arguments to get_model_evaluation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name for the model evaluation.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1735

def get_model_evaluation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::GetModelEvaluationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_model_evaluation..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_model_evaluation.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_model_evaluation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.get_model_evaluation request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_data(request, options = nil) ⇒ ::Gapic::Operation #import_data(name: nil, input_config: nil) ⇒ ::Gapic::Operation

Imports data into a dataset. For Tables this method can only be called on an empty Dataset.

For Tables:

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ImportDataRequest.new

# Call the import_data method.
result = client.import_data request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_data(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_data via a request object, either of type ImportDataRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ImportDataRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #import_data(name: nil, input_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_data via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.

    • input_config (::Google::Cloud::AutoML::V1::InputConfig, ::Hash) (defaults to: nil)

      Required. The desired input location and its domain specific semantics, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 751

def import_data request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ImportDataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_data..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.import_data.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_data.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.import_data request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_datasets(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset> #list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>

Lists datasets in a project.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new

# Call the list_datasets method.
result = client.list_datasets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::AutoML::V1::Dataset.
  p item
end

Overloads:

  • #list_datasets(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>

    Pass arguments to list_datasets via a request object, either of type ListDatasetsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ListDatasetsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Dataset>

    Pass arguments to list_datasets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the project from which to list datasets.

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request.

      • dataset_metadata - for existence of the case (e.g. image_classification_dataset_metadata:*). Some examples of using the filter are:

      • translation_dataset_metadata:* --> The dataset has translation_dataset_metadata.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. Server may return fewer results than requested. If unspecified, server will pick a default size.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results for the server to return Typically obtained via ListDatasetsResponse.next_page_token of the previous AutoMl.ListDatasets call.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 480

def list_datasets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListDatasetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_datasets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_datasets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_datasets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.list_datasets request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_datasets, "datasets", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_model_evaluations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation> #list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>

Lists model evaluations.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new

# Call the list_model_evaluations method.
result = client.list_model_evaluations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation.
  p item
end

Overloads:

  • #list_model_evaluations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>

    Pass arguments to list_model_evaluations via a request object, either of type ListModelEvaluationsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::ModelEvaluation>

    Pass arguments to list_model_evaluations via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.

    • filter (::String) (defaults to: nil)

      Required. An expression for filtering the results of the request.

      • annotation_spec_id - for =, != or existence. See example below for the last.

      Some examples of using the filter are:

      • annotation_spec_id!=4 --> The model evaluation was done for annotation spec with ID different than 4.
      • NOT annotation_spec_id:* --> The model evaluation was done for aggregate of all annotation specs.
    • page_size (::Integer) (defaults to: nil)

      Requested page size.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results for the server to return. Typically obtained via ListModelEvaluationsResponse.next_page_token of the previous AutoMl.ListModelEvaluations call.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1839

def list_model_evaluations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelEvaluationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_model_evaluations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_model_evaluations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_model_evaluations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.list_model_evaluations request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, "model_evaluation", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_models(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model> #list_models(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>

Lists models.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::ListModelsRequest.new

# Call the list_models method.
result = client.list_models request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::AutoML::V1::Model.
  p item
end

Overloads:

  • #list_models(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>

    Pass arguments to list_models via a request object, either of type ListModelsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::ListModelsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_models(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1::Model>

    Pass arguments to list_models via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the project, from which to list the models.

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request.

      • model_metadata - for existence of the case (e.g. video_classification_model_metadata:*).
      • dataset_id - for = or !=. Some examples of using the filter are:

      • image_classification_model_metadata:* --> The model has image_classification_model_metadata.

      • dataset_id=5 --> The model was created from a dataset with ID 5.

    • page_size (::Integer) (defaults to: nil)

      Requested page size.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results for the server to return Typically obtained via ListModelsResponse.next_page_token of the previous AutoMl.ListModels call.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1194

def list_models request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::ListModelsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_models..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_models.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_models.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.list_models request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_models, "model", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#undeploy_model(request, options = nil) ⇒ ::Gapic::Operation #undeploy_model(name: nil) ⇒ ::Gapic::Operation

Undeploys a model. If the model is not deployed this method has no effect.

Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::UndeployModelRequest.new

# Call the undeploy_model method.
result = client.undeploy_model request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #undeploy_model(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to undeploy_model via a request object, either of type UndeployModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::UndeployModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #undeploy_model(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to undeploy_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the model to undeploy.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1560

def undeploy_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UndeployModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.undeploy_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.undeploy_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.undeploy_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.undeploy_model request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


182
183
184
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 182

def universe_domain
  @auto_ml_stub.universe_domain
end

#update_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset #update_dataset(dataset: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

Updates a dataset.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new

# Call the update_dataset method.
result = client.update_dataset request

# The returned object is of type Google::Cloud::AutoML::V1::Dataset.
p result

Overloads:

  • #update_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

    Pass arguments to update_dataset via a request object, either of type UpdateDatasetRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::UpdateDatasetRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_dataset(dataset: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1::Dataset

    Pass arguments to update_dataset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 562

def update_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_dataset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.update_dataset request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_model(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Model #update_model(model: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1::Model

Updates a model.

Examples:

Basic example

require "google/cloud/automl/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1::AutoML::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1::UpdateModelRequest.new

# Call the update_model method.
result = client.update_model request

# The returned object is of type Google::Cloud::AutoML::V1::Model.
p result

Overloads:

  • #update_model(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1::Model

    Pass arguments to update_model via a request object, either of type UpdateModelRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AutoML::V1::UpdateModelRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_model(model: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1::Model

    Pass arguments to update_model via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
# File 'lib/google/cloud/automl/v1/automl/rest/client.rb', line 1367

def update_model request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1::UpdateModelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_model..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AutoML::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_model.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_model.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @auto_ml_stub.update_model request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end