module TQ::ServiceAccount

Public Instance Methods

client(file) click to toggle source
# File lib/tq.rb, line 72
def client(file)
  creds = Google::Auth::ServiceAccountCredentials.make_creds(
     :json_key_io => File.open(file, 'r'),
     :scope => TQ::API_SCOPES
  )
  creds.fetch_access_token!

  client = CloudTasks::CloudTasksService.new
  client.authorization = creds
  client
end