Class: TesoteSdk::V1::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/tesote_sdk/v1/status.rb

Overview

GET /status, GET /whoami — both live under the API root, NOT under /v1. We bypass the transport’s version_segment by using opts is not enough; we need an absolute path. The transport joins base_url + version_segment + path, so we send a leading double-slash path? No — instead we use an unversioned subclient via raw_request.

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ Status

Returns a new instance of Status.



9
10
11
# File 'lib/tesote_sdk/v1/status.rb', line 9

def initialize(transport)
  @transport = transport
end

Instance Method Details

#status(opts: {}) ⇒ Object

GET /status (no auth required, but transport always sends it — server ignores when not required).



15
16
17
18
# File 'lib/tesote_sdk/v1/status.rb', line 15

def status(opts: {})
  body = @transport.request_unversioned('GET', 'status', opts: opts)
  Models::StatusResult.from_hash(body)
end

#whoami(opts: {}) ⇒ Object

GET /whoami



21
22
23
24
# File 'lib/tesote_sdk/v1/status.rb', line 21

def whoami(opts: {})
  body = @transport.request_unversioned('GET', 'whoami', opts: opts)
  Models::Whoami.from_hash(body)
end