Class: Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/automl/v1beta1/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 kebab-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, #column_spec_path, #dataset_path, #location_path, #model_evaluation_path, #model_path, #table_spec_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::V1beta1::AutoML::Rest::Client.new

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

Yields:

  • (config)

    Configure the AutoMl client.

Yield Parameters:



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 223

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::V1beta1::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::V1beta1::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::V1beta1::AutoML::Rest::Operations (readonly)

Get the associated client for long-running operations.



266
267
268
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 266

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::V1beta1::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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 77

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "AutoML", "V1beta1"]
    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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

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

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

    default_config.rpcs.update_table_spec.timeout = 5.0

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

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

    default_config.rpcs.update_column_spec.timeout = 5.0

    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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

    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.export_evaluated_examples.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: [14, 4]
    }

    default_config.rpcs.list_model_evaluations.timeout = 5.0

    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:



193
194
195
196
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 193

def configure
  yield @config if block_given?
  @config
end

#create_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::Dataset #create_dataset(parent: nil, dataset: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::Dataset

Creates a dataset.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

  • #create_dataset(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::Dataset

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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) ⇒ ::Google::Cloud::AutoML::V1beta1::Dataset

    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::V1beta1::Dataset, ::Hash) (defaults to: nil)

      Required. The dataset to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 315

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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|
    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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::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.



1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1544

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 666

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1815

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.v1beta1.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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1917

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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:

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.



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 856

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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_evaluated_examples(request, options = nil) ⇒ ::Gapic::Operation #export_evaluated_examples(name: nil, output_config: nil) ⇒ ::Gapic::Operation

Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated.

This export is available only for 30 days since the model evaluation is created.

Currently only available for Tables.

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

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

# Call the export_evaluated_examples method.
result = client.export_evaluated_examples 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_evaluated_examples(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest, ::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_evaluated_examples(name: nil, output_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to export_evaluated_examples 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.



2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 2209

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest

  # 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_evaluated_examples..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::V1beta1::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_evaluated_examples.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.export_evaluated_examples.retry_policy

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

  @auto_ml_stub.export_evaluated_examples 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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 2106

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::AnnotationSpec #get_annotation_spec(name: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::AnnotationSpec

Gets an annotation spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 936

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::V1beta1::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::V1beta1::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_column_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec #get_column_spec(name: nil, field_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

Gets a column spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec.
p result

Overloads:

  • #get_column_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest, ::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_column_spec(name: nil, field_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

    Pass arguments to get_column_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 column spec to retrieve.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Mask specifying which fields to read.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
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
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1275

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest

  # 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_column_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::V1beta1::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_column_spec.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_column_spec.retry_policy

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

  @auto_ml_stub.get_column_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::V1beta1::Dataset #get_dataset(name: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::Dataset

Gets a dataset.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 394

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::Model #get_model(name: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::Model

Gets a model.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1624

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::ModelEvaluation #get_model_evaluation(name: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ModelEvaluation

Gets a model evaluation.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 2289

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::V1beta1::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::V1beta1::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

#get_table_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec #get_table_spec(name: nil, field_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

Gets a table spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec.
p result

Overloads:

  • #get_table_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::GetTableSpecRequest, ::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_table_spec(name: nil, field_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

    Pass arguments to get_table_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 table spec to retrieve.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Mask specifying which fields to read.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1050
1051
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1017

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::GetTableSpecRequest

  # 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_table_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::V1beta1::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_table_spec.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_table_spec.retry_policy

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

  @auto_ml_stub.get_table_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

#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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::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.



765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 765

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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_column_specs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ColumnSpec> #list_column_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ColumnSpec>

Lists column specs in a table spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

# Call the list_column_specs method.
result = client.list_column_specs 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::V1beta1::ColumnSpec.
  p item
end

Overloads:

  • #list_column_specs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ColumnSpec>

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest, ::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_column_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ColumnSpec>

    Pass arguments to list_column_specs 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 table spec to list column specs from.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Mask specifying which fields to read.

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

      Filter expression, see go/filtering.

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

      Requested page size. The server can return fewer results than requested. If unspecified, the 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 from the ListColumnSpecsResponse.next_page_token field of the previous AutoMl.ListColumnSpecs 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.



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
1402
1403
1404
1405
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1370

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest

  # 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_column_specs..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::V1beta1::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_column_specs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_column_specs.retry_policy

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

  @auto_ml_stub.list_column_specs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_column_specs, "column_specs", 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_datasets(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::Dataset> #list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::Dataset>

Lists datasets in a project.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::Dataset.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 494

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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::V1beta1::ModelEvaluation> #list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ModelEvaluation>

Lists model evaluations.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::ModelEvaluation.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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)

      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.



2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 2393

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::V1beta1::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::V1beta1::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::V1beta1::Model> #list_models(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::Model>

Lists models.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::Model.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
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
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1724

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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

#list_table_specs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::TableSpec> #list_table_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::TableSpec>

Lists table specs in a dataset.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

# Call the list_table_specs method.
result = client.list_table_specs 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::V1beta1::TableSpec.
  p item
end

Overloads:

  • #list_table_specs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::TableSpec>

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest, ::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_table_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::TableSpec>

    Pass arguments to list_table_specs 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 dataset to list table specs from.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Mask specifying which fields to read.

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

      Filter expression, see go/filtering.

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

      Requested page size. The server can return fewer results than requested. If unspecified, the 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 from the ListTableSpecsResponse.next_page_token field of the previous AutoMl.ListTableSpecs 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.



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1112

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest

  # 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_table_specs..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::V1beta1::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_table_specs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_table_specs.retry_policy

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

  @auto_ml_stub.list_table_specs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_table_specs, "table_specs", 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/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 2010

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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)


203
204
205
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 203

def universe_domain
  @auto_ml_stub.universe_domain
end

#update_column_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec #update_column_spec(column_spec: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

Updates a column spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec.
p result

Overloads:

  • #update_column_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest, ::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_column_spec(column_spec: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::ColumnSpec

    Pass arguments to update_column_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:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1452

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest

  # 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_column_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::V1beta1::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_column_spec.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_column_spec.retry_policy

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

  @auto_ml_stub.update_column_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

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

Updates a dataset.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::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::V1beta1::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.



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 576

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::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::V1beta1::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_table_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec #update_table_spec(table_spec: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

Updates a table spec.

Examples:

Basic example

require "google/cloud/automl/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec.
p result

Overloads:

  • #update_table_spec(request, options = nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

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

    Parameters:

    • request (::Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest, ::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_table_spec(table_spec: nil, update_mask: nil) ⇒ ::Google::Cloud::AutoML::V1beta1::TableSpec

    Pass arguments to update_table_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:

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
# File 'lib/google/cloud/automl/v1beta1/automl/rest/client.rb', line 1194

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest

  # 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_table_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::V1beta1::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_table_spec.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_table_spec.retry_policy

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

  @auto_ml_stub.update_table_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