Module: Google::Area120::Tables

Defined in:
lib/google/area120/tables.rb,
lib/google/area120/tables/version.rb

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.tables_service(version: :v1alpha1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for TablesService.

By default, this returns an instance of Google::Area120::Tables::V1alpha1::TablesService::Client for a gRPC client for version V1alpha1 of the API. However, you can specify a different API version by passing it in the version parameter. If the TablesService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

About TablesService

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

  • The API has a collection of Table resources, named tables/*

  • Each Table has a collection of Row resources, named tables/*/rows/*

  • The API has a collection of Workspace resources, named workspaces/*.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1alpha1)

    The API version to connect to. Optional. Defaults to :v1alpha1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/google/area120/tables.rb', line 63

def self.tables_service version: :v1alpha1, transport: :grpc, &block
  require "google/area120/tables/#{version.to_s.downcase}"

  package_name = Google::Area120::Tables
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Area120::Tables.const_get(package_name).const_get(:TablesService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end