Class: Deepgram::Management::Response
- Inherits:
-
Object
- Object
- Deepgram::Management::Response
- 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
- #balances ⇒ Object
- #distribution_credentials ⇒ Object
-
#initialize(status:, body:, headers:) ⇒ Response
constructor
A new instance of Response.
- #invites ⇒ Object
- #keys ⇒ Object
- #members ⇒ Object
-
#projects ⇒ Object
Methods for accessing specific parts of the response data, such as projects, keys, members, etc.
-
#raw ⇒ Object
Parses the response body as JSON and returns the raw data.
- #requests ⇒ Object
- #scopes ⇒ Object
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
#balances ⇒ Object
264 265 266 |
# File 'lib/deepgram/management.rb', line 264 def balances raw['balances'] end |
#distribution_credentials ⇒ Object
268 269 270 |
# File 'lib/deepgram/management.rb', line 268 def distribution_credentials raw['distribution_credentials'] end |
#invites ⇒ Object
256 257 258 |
# File 'lib/deepgram/management.rb', line 256 def invites raw['invites'] end |
#keys ⇒ Object
244 245 246 |
# File 'lib/deepgram/management.rb', line 244 def keys raw['api_keys'] end |
#members ⇒ Object
248 249 250 |
# File 'lib/deepgram/management.rb', line 248 def members raw['members'] end |
#projects ⇒ Object
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 |
#raw ⇒ Object
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 |
#requests ⇒ Object
260 261 262 |
# File 'lib/deepgram/management.rb', line 260 def requests raw['requests'] end |
#scopes ⇒ Object
252 253 254 |
# File 'lib/deepgram/management.rb', line 252 def scopes raw['scopes'] end |