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

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

Overview

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 client object.

Examples:


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

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

Yields:

  • (config)

    Configure the AutoMl client.

Yield Parameters:



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 206

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/automl/v1beta1/service_services_pb"

  # 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 == Client.configure.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 = Operations.new do |config|
    config.credentials = credentials
    config.endpoint = @config.endpoint
  end

  @auto_ml_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::AutoML::V1beta1::AutoMl::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::AutoML::V1beta1::AutoML::Operations (readonly)

Get the associated client for long-running operations.



252
253
254
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 252

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::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



69
70
71
72
73
74
75
76
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
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 69

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:



185
186
187
188
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 185

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

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1620
1621
1622
1623
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
1659
1660
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1620

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_model, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 678

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_dataset, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1911
1912
1913
1914
1915
1916
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
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1911

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_model, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



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
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2019

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :deploy_model, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 880

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_data, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2329

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_evaluated_examples, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



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
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2220

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_model, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 966

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_annotation_spec, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1331

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_column_spec, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1706

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_model, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2415

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_model_evaluation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1053

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_table_spec, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 783

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :import_data, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_column_specs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ColumnSpec> #list_column_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AutoML::V1beta1::ColumnSpec.
  p response
end

Overloads:

  • #list_column_specs(request, options = nil) ⇒ ::Gapic::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1434

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_column_specs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_column_specs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_datasets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::Dataset> #list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AutoML::V1beta1::Dataset.
  p response
end

Overloads:

  • #list_datasets(request, options = nil) ⇒ ::Gapic::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC 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
530
531
532
533
534
# File 'lib/google/cloud/automl/v1beta1/automl/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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_datasets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_model_evaluations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::ModelEvaluation> #list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AutoML::V1beta1::ModelEvaluation.
  p response
end

Overloads:

  • #list_model_evaluations(request, options = nil) ⇒ ::Gapic::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2527

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_model_evaluations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_models(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::Model> #list_models(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AutoML::V1beta1::Model.
  p response
end

Overloads:

  • #list_models(request, options = nil) ⇒ ::Gapic::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1814
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
1851
1852
1853
1854
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1814

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_models, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_table_specs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AutoML::V1beta1::TableSpec> #list_table_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AutoML::V1beta1::TableSpec.
  p response
end

Overloads:

  • #list_table_specs(request, options = nil) ⇒ ::Gapic::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1156

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_table_specs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_table_specs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 2118

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :undeploy_model, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1522

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.column_spec&.name
    header_params["column_spec.name"] = request.column_spec.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_column_spec, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 582

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.dataset&.name
    header_params["dataset.name"] = request.dataset.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
# File 'lib/google/cloud/automl/v1beta1/automl/client.rb', line 1244

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 and x-goog-user-project 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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.table_spec&.name
    header_params["table_spec.name"] = request.table_spec.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_table_spec, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end