Class: Google::Cloud::Datastore::Credentials

Inherits:
V1::Datastore::Credentials
  • Object
show all
Defined in:
lib/google/cloud/datastore/credentials.rb

Overview

Credentials

Represents the authentication and authorization used to connect to the Datastore API.

Examples:

require "google/cloud/datastore"

keyfile = "/path/to/keyfile.json"
creds = Google::Cloud::Datastore::Credentials.new keyfile

datastore = Google::Cloud::Datastore.new(
  project_id: "my-todo-project",
  credentials: creds
)

datastore.project_id #=> "my-todo-project"