Class: Google::Cloud::PubSub::Credentials

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

Overview

Credentials

Represents the authentication and authorization used to connect to the Pub/Sub API.

Examples:

require "google/cloud/pubsub"

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

pubsub = Google::Cloud::PubSub.new(
  project_id: "my-project",
  credentials: creds
)

pubsub.project_id #=> "my-project"