Class: Smplkit::ManagementClient
- Inherits:
-
Object
- Object
- Smplkit::ManagementClient
- Defined in:
- lib/smplkit/management/client.rb
Overview
Top-level management client. Owns the HTTP transports + CRUD APIs for every resource on the smplkit platform.
Sub-namespaces (mirroring the Python SDK):
- +mgmt.contexts.*+
- +mgmt.context_types.*+
- +mgmt.environments.*+
- +mgmt.services.*+
- +mgmt.account_settings.*+
- +mgmt.config.*+
- +mgmt.flags.*+
- +mgmt.loggers.*+
- +mgmt.log_groups.*+
Constructable both as Smplkit::ManagementClient.new (standalone) and as Smplkit::Client#manage (shared transports).
Each namespace is wired to a generated SmplkitGeneratedClient ApiClient under the hood — auth, request encoding, and response parsing flow through the openapi-generator-produced layer in lib/smplkit/_generated. The wrapper layer keeps the customer-facing domain models (Flag, Config, etc.) and converts at the boundary via the existing <resource>_from_resource helpers.
Defined Under Namespace
Modules: ErrorMapping, PaginatedFetch, ResourceShim Classes: AccountSettingsNamespace, ConfigNamespace, ContextTypesNamespace, ContextsNamespace, EnvironmentsNamespace, FlagsNamespace, LogGroupsNamespace, LoggersNamespace, ServicesNamespace
Constant Summary collapse
- RUNTIME_PAGE_SIZE =
1000- SDK_OWNED_HEADERS =
%w[authorization content-type user-agent].freeze
Instance Attribute Summary collapse
-
#account_settings ⇒ Object
readonly
Returns the value of attribute account_settings.
-
#audit ⇒ Object
readonly
Returns the value of attribute audit.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#context_types ⇒ Object
readonly
Returns the value of attribute context_types.
-
#contexts ⇒ Object
readonly
Returns the value of attribute contexts.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#log_groups ⇒ Object
readonly
Returns the value of attribute log_groups.
-
#loggers ⇒ Object
readonly
Returns the value of attribute loggers.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
Class Method Summary collapse
Instance Method Summary collapse
- #_app_http ⇒ Object
- #_audit_http ⇒ Object
- #_config_http ⇒ Object
- #_flags_http ⇒ Object
- #_logging_http ⇒ Object
- #_resolved ⇒ Object
- #close ⇒ Object
-
#initialize(api_key: nil, base_domain: nil, scheme: nil, profile: nil, debug: nil, _resolved: nil, extra_headers: nil) ⇒ ManagementClient
constructor
A new instance of ManagementClient.
Constructor Details
#initialize(api_key: nil, base_domain: nil, scheme: nil, profile: nil, debug: nil, _resolved: nil, extra_headers: nil) ⇒ ManagementClient
Returns a new instance of ManagementClient.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/smplkit/management/client.rb', line 44 def initialize(api_key: nil, base_domain: nil, scheme: nil, profile: nil, debug: nil, _resolved: nil, extra_headers: nil) cfg = _resolved || ConfigResolution.resolve_management_config( api_key: api_key, base_domain: base_domain, scheme: scheme, profile: profile, debug: debug ) Smplkit.enable_debug if cfg.debug @resolved = cfg @extra_headers = extra_headers @app_api_client = build_api_client(SmplkitGeneratedClient::App, "app", cfg) @config_api_client = build_api_client(SmplkitGeneratedClient::Config, "config", cfg) @flags_api_client = build_api_client(SmplkitGeneratedClient::Flags, "flags", cfg) @logging_api_client = build_api_client(SmplkitGeneratedClient::Logging, "logging", cfg) @audit_api_client = build_api_client(SmplkitGeneratedClient::Audit, "audit", cfg) @contexts = ContextsNamespace.new(@app_api_client) @context_types = ContextTypesNamespace.new(@app_api_client) @environments = EnvironmentsNamespace.new(@app_api_client) @services = ServicesNamespace.new(@app_api_client) @account_settings = AccountSettingsNamespace.new(@app_api_client) @config = ConfigNamespace.new(@config_api_client) @flags = FlagsNamespace.new(@flags_api_client) @loggers = LoggersNamespace.new(@logging_api_client) @log_groups = LogGroupsNamespace.new(@logging_api_client) @audit = Management::AuditNamespace.new(@audit_api_client) end |
Instance Attribute Details
#account_settings ⇒ Object (readonly)
Returns the value of attribute account_settings.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def account_settings @account_settings end |
#audit ⇒ Object (readonly)
Returns the value of attribute audit.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def audit @audit end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def config @config end |
#context_types ⇒ Object (readonly)
Returns the value of attribute context_types.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def context_types @context_types end |
#contexts ⇒ Object (readonly)
Returns the value of attribute contexts.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def contexts @contexts end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def environments @environments end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def flags @flags end |
#log_groups ⇒ Object (readonly)
Returns the value of attribute log_groups.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def log_groups @log_groups end |
#loggers ⇒ Object (readonly)
Returns the value of attribute loggers.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def loggers @loggers end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
37 38 39 |
# File 'lib/smplkit/management/client.rb', line 37 def services @services end |
Class Method Details
.from_resolved(resolved, extra_headers: nil) ⇒ Object
40 41 42 |
# File 'lib/smplkit/management/client.rb', line 40 def self.from_resolved(resolved, extra_headers: nil) new(_resolved: resolved, extra_headers: extra_headers) end |
Instance Method Details
#_app_http ⇒ Object
80 |
# File 'lib/smplkit/management/client.rb', line 80 def _app_http = @app_api_client |
#_audit_http ⇒ Object
84 |
# File 'lib/smplkit/management/client.rb', line 84 def _audit_http = @audit_api_client |
#_config_http ⇒ Object
81 |
# File 'lib/smplkit/management/client.rb', line 81 def _config_http = @config_api_client |
#_flags_http ⇒ Object
82 |
# File 'lib/smplkit/management/client.rb', line 82 def _flags_http = @flags_api_client |
#_logging_http ⇒ Object
83 |
# File 'lib/smplkit/management/client.rb', line 83 def _logging_http = @logging_api_client |
#_resolved ⇒ Object
79 |
# File 'lib/smplkit/management/client.rb', line 79 def _resolved = @resolved |
#close ⇒ Object
74 75 76 77 |
# File 'lib/smplkit/management/client.rb', line 74 def close # The generated ApiClient owns Faraday connections that release on GC. # No explicit shutdown is exposed; this stub keeps the API stable. end |