Class: SeatLayer::Client
- Inherits:
-
Object
- Object
- SeatLayer::Client
- Defined in:
- lib/seatlayer.rb
Overview
The SeatLayer client.
Instance Attribute Summary collapse
-
#channels ⇒ Object
readonly
Returns the value of attribute channels.
-
#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.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/seatlayer.rb', line 24 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) @channels = Channels.new(@http) @sessions = Sessions.new(@http) @webhooks = Webhooks.new(@http) @workspaces = Workspaces.new(@http) end |
Instance Attribute Details
#channels ⇒ Object (readonly)
Returns the value of attribute channels.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def channels @channels end |
#charts ⇒ Object (readonly)
Returns the value of attribute charts.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def charts @charts end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def events @events end |
#inventory ⇒ Object (readonly)
Returns the value of attribute inventory.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def inventory @inventory end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def sessions @sessions end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def webhooks @webhooks end |
#workspaces ⇒ Object (readonly)
Returns the value of attribute workspaces.
22 23 24 |
# File 'lib/seatlayer.rb', line 22 def workspaces @workspaces end |
Instance Method Details
#mode ⇒ String
Returns "live" or "test", derived from the key prefix.
40 41 42 |
# File 'lib/seatlayer.rb', line 40 def mode @http.mode end |
#ready ⇒ Object
Dependency-aware readiness probe.
45 46 47 |
# File 'lib/seatlayer.rb', line 45 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.
51 52 53 |
# File 'lib/seatlayer.rb', line 51 def request(method, path, query: nil, body: nil, idempotency_key: nil) @http.request(method, path, query: query, body: body, idempotency_key: idempotency_key) end |