class Google::Area120::Tables::V1alpha1::TablesService::Client

Client for the TablesService service.

The Tables Service provides an API for reading and updating tables. It defines the following resource model:

Attributes

tables_service_stub[R]

@private

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the TablesService Client class.

See {::Google::Area120::Tables::V1alpha1::TablesService::Client::Configuration} for a description of the configuration fields.

@example

# Modify the configuration for all TablesService clients
::Google::Area120::Tables::V1alpha1::TablesService::Client.configure do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 67
def self.configure
  @configure ||= begin
    namespace = ["Google", "Area120", "Tables", "V1alpha1"]
    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.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_table.timeout = 60.0

    default_config.rpcs.list_tables.timeout = 60.0

    default_config.rpcs.get_workspace.timeout = 60.0

    default_config.rpcs.list_workspaces.timeout = 60.0

    default_config.rpcs.get_row.timeout = 60.0

    default_config.rpcs.list_rows.timeout = 60.0

    default_config.rpcs.create_row.timeout = 60.0

    default_config.rpcs.batch_create_rows.timeout = 60.0

    default_config.rpcs.update_row.timeout = 60.0

    default_config.rpcs.batch_update_rows.timeout = 60.0

    default_config.rpcs.delete_row.timeout = 60.0

    default_config.rpcs.batch_delete_rows.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new TablesService client object.

@example

# Create a client using the default configuration
client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new

# Create a client using a custom configuration
client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new do |config|
  config.timeout = 10.0
end

@yield [config] Configure the TablesService client. @yieldparam config [Client::Configuration]

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 149
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/area120/tables/v1alpha1/tables_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

  @tables_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Area120::Tables::V1alpha1::TablesService::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

batch_create_rows(request, options = nil) { |response, operation| ... } click to toggle source

Creates multiple rows.

@overload batch_create_rows(request, options = nil)

Pass arguments to `batch_create_rows` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload batch_create_rows(parent: nil, requests: nil)

Pass arguments to `batch_create_rows` 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).

@param parent [::String]
  Required. The parent table where the rows will be created.
  Format: tables/\\{table}
@param requests [::Array<::Google::Area120::Tables::V1alpha1::CreateRowRequest, ::Hash>]
  Required. The request message specifying the rows to create.

  A maximum of 500 rows can be created in a single batch.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 740
def batch_create_rows request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest

  # 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
  metadata = @config.rpcs.batch_create_rows.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :batch_create_rows, 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
batch_delete_rows(request, options = nil) { |response, operation| ... } click to toggle source

Deletes multiple rows.

@overload batch_delete_rows(request, options = nil)

Pass arguments to `batch_delete_rows` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload batch_delete_rows(parent: nil, names: nil)

Pass arguments to `batch_delete_rows` 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).

@param parent [::String]
  Required. The parent table shared by all rows being deleted.
  Format: tables/\\{table}
@param names [::Array<::String>]
  Required. The names of the rows to delete. All rows must belong to the parent table
  or else the entire batch will fail. A maximum of 500 rows can be deleted
  in a batch.
  Format: tables/\\{table}/rows/\\{row}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 1029
def batch_delete_rows request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest

  # 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
  metadata = @config.rpcs.batch_delete_rows.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :batch_delete_rows, 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
batch_update_rows(request, options = nil) { |response, operation| ... } click to toggle source

Updates multiple rows.

@overload batch_update_rows(request, options = nil)

Pass arguments to `batch_update_rows` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload batch_update_rows(parent: nil, requests: nil)

Pass arguments to `batch_update_rows` 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).

@param parent [::String]
  Required. The parent table shared by all rows being updated.
  Format: tables/\\{table}
@param requests [::Array<::Google::Area120::Tables::V1alpha1::UpdateRowRequest, ::Hash>]
  Required. The request messages specifying the rows to update.

  A maximum of 500 rows can be modified in a single batch.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 886
def batch_update_rows request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest

  # 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
  metadata = @config.rpcs.batch_update_rows.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :batch_update_rows, 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
configure() { |config| ... } click to toggle source

Configure the TablesService 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 {Client.configure}.

See {::Google::Area120::Tables::V1alpha1::TablesService::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 128
def configure
  yield @config if block_given?
  @config
end
create_row(request, options = nil) { |response, operation| ... } click to toggle source

Creates a row.

@overload create_row(request, options = nil)

Pass arguments to `create_row` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::CreateRowRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::CreateRowRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_row(parent: nil, row: nil, view: nil)

Pass arguments to `create_row` 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).

@param parent [::String]
  Required. The parent table where this row will be created.
  Format: tables/\\{table}
@param row [::Google::Area120::Tables::V1alpha1::Row, ::Hash]
  Required. The row to create.
@param view [::Google::Area120::Tables::V1alpha1::View]
  Optional. Column key to use for values in the row.
  Defaults to user entered name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::Row] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::Row]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 667
def create_row request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::CreateRowRequest

  # 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
  metadata = @config.rpcs.create_row.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :create_row, 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
delete_row(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a row.

@overload delete_row(request, options = nil)

Pass arguments to `delete_row` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::DeleteRowRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::DeleteRowRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_row(name: nil)

Pass arguments to `delete_row` 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).

@param name [::String]
  Required. The name of the row to delete.
  Format: tables/\\{table}/rows/\\{row}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 955
def delete_row request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::DeleteRowRequest

  # 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
  metadata = @config.rpcs.delete_row.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :delete_row, 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_row(request, options = nil) { |response, operation| ... } click to toggle source

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

@overload get_row(request, options = nil)

Pass arguments to `get_row` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::GetRowRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::GetRowRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_row(name: nil, view: nil)

Pass arguments to `get_row` 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).

@param name [::String]
  Required. The name of the row to retrieve.
  Format: tables/\\{table}/rows/\\{row}
@param view [::Google::Area120::Tables::V1alpha1::View]
  Optional. Column key to use for values in the row.
  Defaults to user entered name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::Row] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::Row]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 504
def get_row request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetRowRequest

  # 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
  metadata = @config.rpcs.get_row.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :get_row, 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(request, options = nil) { |response, operation| ... } click to toggle source

Gets a table. Returns NOT_FOUND if the table does not exist.

@overload get_table(request, options = nil)

Pass arguments to `get_table` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::GetTableRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::GetTableRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_table(name: nil)

Pass arguments to `get_table` 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).

@param name [::String]
  Required. The name of the table to retrieve.
  Format: tables/\\{table}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::Table] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::Table]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 217
def get_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetTableRequest

  # 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
  metadata = @config.rpcs.get_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :get_table, 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_workspace(request, options = nil) { |response, operation| ... } click to toggle source

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

@overload get_workspace(request, options = nil)

Pass arguments to `get_workspace` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_workspace(name: nil)

Pass arguments to `get_workspace` 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).

@param name [::String]
  Required. The name of the workspace to retrieve.
  Format: workspaces/\\{workspace}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::Workspace] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::Workspace]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 359
def get_workspace request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest

  # 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
  metadata = @config.rpcs.get_workspace.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :get_workspace, 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
list_rows(request, options = nil) { |response, operation| ... } click to toggle source

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

@overload list_rows(request, options = nil)

Pass arguments to `list_rows` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::ListRowsRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::ListRowsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_rows(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil)

Pass arguments to `list_rows` 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).

@param parent [::String]
  Required. The parent table.
  Format: tables/\\{table}
@param page_size [::Integer]
  The maximum number of rows to return. The service may return fewer than
  this value.

  If unspecified, at most 50 rows are returned. The maximum value is 1,000;
  values above 1,000 are coerced to 1,000.
@param page_token [::String]
  A page token, received from a previous `ListRows` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListRows` must match
  the call that provided the page token.
@param view [::Google::Area120::Tables::V1alpha1::View]
  Optional. Column key to use for values in the row.
  Defaults to user entered name.
@param filter [::String]
  Optional. Raw text query to search for in rows of the table.
  Special characters must be escaped. Logical operators and field specific
  filtering not supported.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Row>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Row>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 592
def list_rows request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListRowsRequest

  # 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
  metadata = @config.rpcs.list_rows.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :list_rows, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @tables_service_stub, :list_rows, 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_tables(request, options = nil) { |response, operation| ... } click to toggle source

Lists tables for the user.

@overload list_tables(request, options = nil)

Pass arguments to `list_tables` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::ListTablesRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::ListTablesRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_tables(page_size: nil, page_token: nil)

Pass arguments to `list_tables` 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).

@param page_size [::Integer]
  The maximum number of tables to return. The service may return fewer than
  this value.

  If unspecified, at most 20 tables are returned. The maximum value is 100;
  values above 100 are coerced to 100.
@param page_token [::String]
  A page token, received from a previous `ListTables` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListTables` must match
  the call that provided the page token.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Table>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Table>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 295
def list_tables request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListTablesRequest

  # 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
  metadata = @config.rpcs.list_tables.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @tables_service_stub.call_rpc :list_tables, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @tables_service_stub, :list_tables, 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_workspaces(request, options = nil) { |response, operation| ... } click to toggle source

Lists workspaces for the user.

@overload list_workspaces(request, options = nil)

Pass arguments to `list_workspaces` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_workspaces(page_size: nil, page_token: nil)

Pass arguments to `list_workspaces` 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).

@param page_size [::Integer]
  The maximum number of workspaces to return. The service may return fewer
  than this value.

  If unspecified, at most 10 workspaces are returned. The maximum value is
  25; values above 25 are coerced to 25.
@param page_token [::String]
  A page token, received from a previous `ListWorkspaces` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListWorkspaces` must
  match the call that provided the page token.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Workspace>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Workspace>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 437
def list_workspaces request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest

  # 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
  metadata = @config.rpcs.list_workspaces.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @tables_service_stub.call_rpc :list_workspaces, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @tables_service_stub, :list_workspaces, 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
update_row(request, options = nil) { |response, operation| ... } click to toggle source

Updates a row.

@overload update_row(request, options = nil)

Pass arguments to `update_row` via a request object, either of type
{::Google::Area120::Tables::V1alpha1::UpdateRowRequest} or an equivalent Hash.

@param request [::Google::Area120::Tables::V1alpha1::UpdateRowRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_row(row: nil, update_mask: nil, view: nil)

Pass arguments to `update_row` 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).

@param row [::Google::Area120::Tables::V1alpha1::Row, ::Hash]
  Required. The row to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  The list of fields to update.
@param view [::Google::Area120::Tables::V1alpha1::View]
  Optional. Column key to use for values in the row.
  Defaults to user entered name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Area120::Tables::V1alpha1::Row] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Area120::Tables::V1alpha1::Row]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/area120/tables/v1alpha1/tables_service/client.rb, line 813
def update_row request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::UpdateRowRequest

  # 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
  metadata = @config.rpcs.update_row.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

  @tables_service_stub.call_rpc :update_row, 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