Class: Shipeasy::Admin::Client
- Inherits:
-
Object
- Object
- Shipeasy::Admin::Client
- Defined in:
- lib/shipeasy/admin.rb
Overview
Programmatic client for the Shipeasy Admin REST API. Each resource group is a lazily-constructed, memoized reader whose methods map 1:1 to the OpenAPI operations.
This is the LEAN admin surface: the vendored spec is the dedicated server-SDK contract (marketplace/openapi/spec/openapi-sdk.yaml in the monorepo), seven operations across three capabilities — file a public ticket (#ops), toggle a kill switch (#killswitch), manage a flag's whitelist (#flags). The rest of the admin API (experiments, metrics, events, configs, i18n, projects, …) is intentionally NOT here; reach it through the Shipeasy CLI or MCP, which consume the complete spec.
Constant Summary collapse
- APIS =
Friendly reader name => generated Api class.
{ flags: Generated::FlagsApi, killswitch: Generated::KillswitchApi, ops: Generated::OpsApi, }.freeze
Instance Attribute Summary collapse
-
#api_client ⇒ Object
readonly
The underlying generated ApiClient (advanced/escape hatch).
Instance Method Summary collapse
-
#initialize(api_key:, project_id: nil, base_url: "https://shipeasy.ai", client_key: nil) ⇒ Client
constructor
Two of the seven operations — #ops.create_public_bug and #ops.create_public_feature_request — are the PUBLIC ticket intake.
Constructor Details
#initialize(api_key:, project_id: nil, base_url: "https://shipeasy.ai", client_key: nil) ⇒ Client
Two of the seven operations — #ops.create_public_bug and
#ops.create_public_feature_request — are the PUBLIC ticket intake. They
live on the Shipeasy edge worker and authenticate with a CLIENT key
(X-SDK-Key), not the admin key, so pass client_key: if you want to
call them. The generated client routes them to the edge host itself.
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/shipeasy/admin.rb', line 73 def initialize(api_key:, project_id: nil, base_url: "https://shipeasy.ai", client_key: nil) config = Generated::Configuration.new config.access_token = api_key config.api_key["clientSdkKey"] = client_key if client_key scheme, _, host = base_url.rpartition("://") config.scheme = scheme unless scheme.empty? config.host = host.empty? ? base_url : host @api_client = Generated::ApiClient.new(config) @api_client.default_headers["X-Project-Id"] = project_id if project_id @apis = {} end |
Instance Attribute Details
#api_client ⇒ Object (readonly)
The underlying generated ApiClient (advanced/escape hatch).
87 88 89 |
# File 'lib/shipeasy/admin.rb', line 87 def api_client @api_client end |