Class: SeatLayer::Client
- Inherits:
-
Object
- Object
- SeatLayer::Client
- Defined in:
- lib/seatlayer.rb
Overview
The SeatLayer client.
Instance Attribute Summary collapse
-
#charts ⇒ Object
readonly
Returns the value of attribute charts.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#inventory ⇒ Object
readonly
Returns the value of attribute inventory.
-
#sessions ⇒ Object
readonly
Returns the value of attribute sessions.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
-
#workspaces ⇒ Object
readonly
Returns the value of attribute workspaces.
Instance Method Summary collapse
-
#initialize(secret_key, base_url: HTTPClient::DEFAULT_BASE_URL, max_retries: HTTPClient::DEFAULT_MAX_RETRIES, timeout: HTTPClient::DEFAULT_TIMEOUT, transport: nil) ⇒ Client
constructor
A new instance of Client.
-
#mode ⇒ String
"live" or "test", derived from the key prefix.
-
#ready ⇒ Object
Dependency-aware readiness probe.
-
#request(method, path, query: nil, body: nil, idempotency_key: nil) ⇒ Object
Escape hatch for surface this SDK does not wrap yet.
Constructor Details
#initialize(secret_key, base_url: HTTPClient::DEFAULT_BASE_URL, max_retries: HTTPClient::DEFAULT_MAX_RETRIES, timeout: HTTPClient::DEFAULT_TIMEOUT, transport: nil) ⇒ Client
Returns a new instance of Client.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/seatlayer.rb', line 23 def initialize(secret_key, base_url: HTTPClient::DEFAULT_BASE_URL, max_retries: HTTPClient::DEFAULT_MAX_RETRIES, timeout: HTTPClient::DEFAULT_TIMEOUT, transport: nil) @http = HTTPClient.new(secret_key: secret_key, base_url: base_url, max_retries: max_retries, timeout: timeout, transport: transport) @charts = Charts.new(@http) @events = Events.new(@http) @inventory = Inventory.new(@http) @sessions = Sessions.new(@http) @webhooks = Webhooks.new(@http) @workspaces = Workspaces.new(@http) end |
Instance Attribute Details
#charts ⇒ Object (readonly)
Returns the value of attribute charts.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def charts @charts end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def events @events end |
#inventory ⇒ Object (readonly)
Returns the value of attribute inventory.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def inventory @inventory end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def sessions @sessions end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def webhooks @webhooks end |
#workspaces ⇒ Object (readonly)
Returns the value of attribute workspaces.
21 22 23 |
# File 'lib/seatlayer.rb', line 21 def workspaces @workspaces end |
Instance Method Details
#mode ⇒ String
Returns "live" or "test", derived from the key prefix.
38 39 40 |
# File 'lib/seatlayer.rb', line 38 def mode @http.mode end |
#ready ⇒ Object
Dependency-aware readiness probe.
43 44 45 |
# File 'lib/seatlayer.rb', line 43 def ready @http.get("/health/ready") end |
#request(method, path, query: nil, body: nil, idempotency_key: nil) ⇒ Object
Escape hatch for surface this SDK does not wrap yet. Carries the same auth, retries, idempotency and error mapping.
49 50 51 |
# File 'lib/seatlayer.rb', line 49 def request(method, path, query: nil, body: nil, idempotency_key: nil) @http.request(method, path, query: query, body: body, idempotency_key: idempotency_key) end |