Class: Deepgram::Management::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/deepgram/management.rb

Overview

Encapsulates the response from the Management API, providing methods to access various response data.

Instance Method Summary collapse

Constructor Details

#initialize(status:, body:, headers:) ⇒ Response

Returns a new instance of Response.



226
227
228
229
230
# File 'lib/deepgram/management.rb', line 226

def initialize(status:, body:, headers:)
  @status = status
  @body = body
  @headers = headers
end

Instance Method Details

#balancesObject



264
265
266
# File 'lib/deepgram/management.rb', line 264

def balances
  raw['balances']
end

#distribution_credentialsObject



268
269
270
# File 'lib/deepgram/management.rb', line 268

def distribution_credentials
  raw['distribution_credentials']
end

#invitesObject



256
257
258
# File 'lib/deepgram/management.rb', line 256

def invites
  raw['invites']
end

#keysObject



244
245
246
# File 'lib/deepgram/management.rb', line 244

def keys
  raw['api_keys']
end

#membersObject



248
249
250
# File 'lib/deepgram/management.rb', line 248

def members
  raw['members']
end

#projectsObject

Methods for accessing specific parts of the response data, such as projects, keys, members, etc. Each method parses the raw JSON data and returns the relevant section, e.g., ‘raw` for `projects`.



240
241
242
# File 'lib/deepgram/management.rb', line 240

def projects
  raw['projects']
end

#rawObject

Parses the response body as JSON and returns the raw data.



233
234
235
# File 'lib/deepgram/management.rb', line 233

def raw
  JSON.parse(@body)
end

#requestsObject



260
261
262
# File 'lib/deepgram/management.rb', line 260

def requests
  raw['requests']
end

#scopesObject



252
253
254
# File 'lib/deepgram/management.rb', line 252

def scopes
  raw['scopes']
end