lib/google-cloud-bigtable.rb in google-cloud-bigtable-0.6.2 vs lib/google-cloud-bigtable.rb in google-cloud-bigtable-0.7.0

- old
+ new

@@ -24,10 +24,11 @@ require "google/cloud" unless defined? Google::Cloud.new require "google/cloud/config" module Google module Cloud + ## # Creates a new object for connecting to the Cloud Bigtable service. # # For more information on connecting to Google Cloud Platform, see the # {file:AUTHENTICATION.md Authentication Guide}. # @@ -37,11 +38,12 @@ # APIs](https://developers.google.com/identity/protocols/OAuth2). # The OAuth scopes for this service. This parameter is ignored if an # updater_proc is supplied. # @param timeout [Integer] # The default timeout, in seconds, for calls made through this client. - # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc] + # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, + # GRPC::Core::ChannelCredentials, Proc] # Provides the means for authenticating requests made by the client. This parameter can # be one of the following types. # `Google::Auth::Credentials` uses the properties of its represented keyfile for # authenticating requests made by this client. # `String` will be treated as the path to the keyfile to use to construct @@ -59,35 +61,36 @@ # this data. Falls back to the default config if not specified # or the specified config is missing data points. # @return [Google::Cloud::Bigtable::Project] # # @example - # require "google/cloud" + # require "google/cloud/bigtable" # # gcloud = Google::Cloud.new # # bigtable = gcloud.bigtable # - def bigtable scope: nil, timeout: nil, credentials: nil, client_config: nil Google::Cloud.bigtable( - project_id: @project, - credentials: (credentials || @keyfile), - scope: scope, - timeout: (timeout || @timeout), + project_id: @project, + credentials: (credentials || @keyfile), + scope: scope, + timeout: (timeout || @timeout), client_config: client_config ) end + ## # Creates a Cloud Bigtable client instance for data, table admin and instance admin # operations. # # @param project_id [String] # Project identifier for the Bigtable service you # are connecting to. If not present, the default project for the # credentials is used. - # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc] + # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, + # GRPC::Core::ChannelCredentials, Proc] # The means for authenticating requests made by the client. This parameter can # be one of the following types. # `Google::Auth::Credentials` uses the properties of its represented keyfile for # authenticating requests made by this client. # `String` will be treated as the path to the keyfile to use to construct @@ -114,26 +117,21 @@ # this data. Falls back to the default config if not specified # or the specified config is missing data points. Optional. # @return [Google::Cloud::Bigtable::Project] # # @example - # require "google/cloud" + # require "google/cloud/bigtable" # # bigtable = Google::Cloud.bigtable - - def self.bigtable \ - project_id: nil, - credentials: nil, - scope: nil, - timeout: nil, - client_config: nil + # + def self.bigtable project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil require "google/cloud/bigtable" Google::Cloud::Bigtable.new( - project_id: project_id, - credentials: credentials, - scope: scope, - timeout: timeout, + project_id: project_id, + credentials: credentials, + scope: scope, + timeout: timeout, client_config: client_config ) end end end @@ -154,10 +152,10 @@ end config.add_field! :project_id, default_project, match: String, allow_nil: true config.add_alias! :project, :project_id config.add_field! :credentials, default_creds, - match: [ + match: [ String, Hash, Google::Auth::Credentials, GRPC::Core::Channel, GRPC::Core::ChannelCredentials,