Class: Shipeasy::Admin::Generated::ConfigsApi
- Inherits:
-
Object
- Object
- Shipeasy::Admin::Generated::ConfigsApi
- Defined in:
- lib/shipeasy_admin/api/configs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_config(create_config_request, opts = {}) ⇒ CreateConfigResponse
Create a dynamic config Creates a new config with the given
schema. -
#create_config_with_http_info(create_config_request, opts = {}) ⇒ Array<(CreateConfigResponse, Integer, Hash)>
Create a dynamic config Creates a new config with the given `schema`.
-
#delete_config(id, opts = {}) ⇒ DeleteConfigResponse
Delete a dynamic config Soft-deletes the config and rebuilds the project's flags KV blob.
-
#delete_config_with_http_info(id, opts = {}) ⇒ Array<(DeleteConfigResponse, Integer, Hash)>
Delete a dynamic config Soft-deletes the config and rebuilds the project's flags KV blob.
-
#discard_config_draft(id, discard_config_draft_request, opts = {}) ⇒ DiscardConfigDraftResponse
Discard a draft Drops the in-flight draft on one env.
-
#discard_config_draft_with_http_info(id, discard_config_draft_request, opts = {}) ⇒ Array<(DiscardConfigDraftResponse, Integer, Hash)>
Discard a draft Drops the in-flight draft on one env.
-
#get_config(id, opts = {}) ⇒ GetConfigResponse
Get one config Returns config metadata plus the latest published values per env and any active draft values.
-
#get_config_with_http_info(id, opts = {}) ⇒ Array<(GetConfigResponse, Integer, Hash)>
Get one config Returns config metadata plus the latest published values per env and any active draft values.
-
#initialize(api_client = ApiClient.default) ⇒ ConfigsApi
constructor
A new instance of ConfigsApi.
-
#list_config_activity(id, opts = {}) ⇒ Array<ListConfigActivityResponseInner>
List config activity Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first.
-
#list_config_activity_with_http_info(id, opts = {}) ⇒ Array<(Array<ListConfigActivityResponseInner>, Integer, Hash)>
List config activity Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first.
-
#list_configs(opts = {}) ⇒ ListConfigsResponse
List dynamic configs Returns a single page of configs ordered by
updated_at desc, id desc. -
#list_configs_with_http_info(opts = {}) ⇒ Array<(ListConfigsResponse, Integer, Hash)>
List dynamic configs Returns a single page of configs ordered by `updated_at desc, id desc`.
-
#publish_config_draft(id, publish_config_draft_request, opts = {}) ⇒ PublishConfigDraftResponse
Publish a draft Promotes the staged draft on one env to a new published version.
-
#publish_config_draft_with_http_info(id, publish_config_draft_request, opts = {}) ⇒ Array<(PublishConfigDraftResponse, Integer, Hash)>
Publish a draft Promotes the staged draft on one env to a new published version.
-
#save_config_draft(id, save_config_draft_request, opts = {}) ⇒ SaveConfigDraftResponse
Save a draft value Stages a value for one env without publishing.
-
#save_config_draft_with_http_info(id, save_config_draft_request, opts = {}) ⇒ Array<(SaveConfigDraftResponse, Integer, Hash)>
Save a draft value Stages a value for one env without publishing.
-
#update_config(id, update_config_request, opts = {}) ⇒ UpdateConfigResponse
Update a dynamic config Partial update.
-
#update_config_schema(id, update_config_schema_request, opts = {}) ⇒ UpdateConfigSchemaResponse
Update a config schema Replaces a config's JSON Schema in place.
-
#update_config_schema_with_http_info(id, update_config_schema_request, opts = {}) ⇒ Array<(UpdateConfigSchemaResponse, Integer, Hash)>
Update a config schema Replaces a config's JSON Schema in place.
-
#update_config_with_http_info(id, update_config_request, opts = {}) ⇒ Array<(UpdateConfigResponse, Integer, Hash)>
Update a dynamic config Partial update.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ConfigsApi
Returns a new instance of ConfigsApi.
19 20 21 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_config(create_config_request, opts = {}) ⇒ CreateConfigResponse
Create a dynamic config
Creates a new config with the given schema. The initial value (or an empty object) is published as version 1 on every env. Returns 409 if name already exists in the project, 400 if value doesn't validate against schema. Use cases - Minimal create — name + schema. Initial value defaults to {}. - Seeded create — supply a flat value to publish the same object on every env. - Per-env seed — supply a { env: value } map for different per-env starting values.
28 29 30 31 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 28 def create_config(create_config_request, opts = {}) data, _status_code, _headers = create_config_with_http_info(create_config_request, opts) data end |
#create_config_with_http_info(create_config_request, opts = {}) ⇒ Array<(CreateConfigResponse, Integer, Hash)>
Create a dynamic config Creates a new config with the given `schema`. The initial `value` (or an empty object) is published as version 1 on every env. Returns `409` if `name` already exists in the project, `400` if `value` doesn't validate against `schema`. Use cases - Minimal create — `name` + `schema`. Initial value defaults to `{}`. - Seeded create — supply a flat `value` to publish the same object on every env. - Per-env seed — supply a `{ env: value }` map for different per-env starting values.
39 40 41 42 43 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 39 def create_config_with_http_info(create_config_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.create_config ...' end # verify the required parameter 'create_config_request' is set if @api_client.config.client_side_validation && create_config_request.nil? fail ArgumentError, "Missing the required parameter 'create_config_request' when calling ConfigsApi.create_config" end # resource path local_var_path = '/api/admin/configs' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_config_request) # return_type return_type = opts[:debug_return_type] || 'CreateConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.create_config", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#create_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_config(id, opts = {}) ⇒ DeleteConfigResponse
Delete a dynamic config Soft-deletes the config and rebuilds the project's flags KV blob. Use case: Tear down a config after its consumers have stopped reading it.
99 100 101 102 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 99 def delete_config(id, opts = {}) data, _status_code, _headers = delete_config_with_http_info(id, opts) data end |
#delete_config_with_http_info(id, opts = {}) ⇒ Array<(DeleteConfigResponse, Integer, Hash)>
Delete a dynamic config Soft-deletes the config and rebuilds the project's flags KV blob. Use case: Tear down a config after its consumers have stopped reading it.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 110 def delete_config_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.delete_config ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.delete_config" end # resource path local_var_path = '/api/admin/configs/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.delete_config", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#delete_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#discard_config_draft(id, discard_config_draft_request, opts = {}) ⇒ DiscardConfigDraftResponse
Discard a draft Drops the in-flight draft on one env. Published values are unaffected. Use case: Abandon an in-progress draft after deciding not to ship it.
166 167 168 169 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 166 def discard_config_draft(id, discard_config_draft_request, opts = {}) data, _status_code, _headers = discard_config_draft_with_http_info(id, discard_config_draft_request, opts) data end |
#discard_config_draft_with_http_info(id, discard_config_draft_request, opts = {}) ⇒ Array<(DiscardConfigDraftResponse, Integer, Hash)>
Discard a draft Drops the in-flight draft on one env. Published values are unaffected. Use case: Abandon an in-progress draft after deciding not to ship it.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 178 def discard_config_draft_with_http_info(id, discard_config_draft_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.discard_config_draft ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.discard_config_draft" end # verify the required parameter 'discard_config_draft_request' is set if @api_client.config.client_side_validation && discard_config_draft_request.nil? fail ArgumentError, "Missing the required parameter 'discard_config_draft_request' when calling ConfigsApi.discard_config_draft" end # resource path local_var_path = '/api/admin/configs/{id}/drafts'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(discard_config_draft_request) # return_type return_type = opts[:debug_return_type] || 'DiscardConfigDraftResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.discard_config_draft", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#discard_config_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_config(id, opts = {}) ⇒ GetConfigResponse
Get one config Returns config metadata plus the latest published values per env and any active draft values. Use this to fetch the JSON the editor renders. Use case: Fetch one config's current published values and any in-flight drafts.
242 243 244 245 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 242 def get_config(id, opts = {}) data, _status_code, _headers = get_config_with_http_info(id, opts) data end |
#get_config_with_http_info(id, opts = {}) ⇒ Array<(GetConfigResponse, Integer, Hash)>
Get one config Returns config metadata plus the latest published values per env and any active draft values. Use this to fetch the JSON the editor renders. Use case: Fetch one config's current published values and any in-flight drafts.
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 253 def get_config_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.get_config ...' end # resource path local_var_path = '/api/admin/configs/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.get_config", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#get_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_config_activity(id, opts = {}) ⇒ Array<ListConfigActivityResponseInner>
List config activity
Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first. Use the limit query parameter to cap the result (1–100, default 20). Use case: Render the activity panel in the config editor or drive a slack notification on publish events.
305 306 307 308 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 305 def list_config_activity(id, opts = {}) data, _status_code, _headers = list_config_activity_with_http_info(id, opts) data end |
#list_config_activity_with_http_info(id, opts = {}) ⇒ Array<(Array<ListConfigActivityResponseInner>, Integer, Hash)>
List config activity Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first. Use the `limit` query parameter to cap the result (1–100, default 20). Use case: Render the activity panel in the config editor or drive a slack notification on publish events.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 317 def list_config_activity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.list_config_activity ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.list_config_activity" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigsApi.list_config_activity, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigsApi.list_config_activity, must be greater than or equal to 1.' end # resource path local_var_path = '/api/admin/configs/{id}/activity'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<ListConfigActivityResponseInner>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.list_config_activity", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#list_config_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_configs(opts = {}) ⇒ ListConfigsResponse
List dynamic configs
Returns a single page of configs ordered by updated_at desc, id desc. Each row includes the latest published version per env and any active drafts. Use case: Snapshot every config in the project — e.g. CI check that asserts no env is stuck on a stale default or that every config has a published value on prod.
382 383 384 385 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 382 def list_configs(opts = {}) data, _status_code, _headers = list_configs_with_http_info(opts) data end |
#list_configs_with_http_info(opts = {}) ⇒ Array<(ListConfigsResponse, Integer, Hash)>
List dynamic configs Returns a single page of configs ordered by `updated_at desc, id desc`. Each row includes the latest published `version` per env and any active drafts. Use case: Snapshot every config in the project — e.g. CI check that asserts no env is stuck on a stale default or that every config has a published value on prod.
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 394 def list_configs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.list_configs ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigsApi.list_configs, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigsApi.list_configs, must be greater than or equal to 1.' end # resource path local_var_path = '/api/admin/configs' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListConfigsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.list_configs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#list_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#publish_config_draft(id, publish_config_draft_request, opts = {}) ⇒ PublishConfigDraftResponse
Publish a draft
Promotes the staged draft on one env to a new published version. The draft must still validate against the current schema. Returns 404 if there is no draft for the given env. Use case: Ship a staged change once you've validated it on a lower env.
456 457 458 459 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 456 def publish_config_draft(id, publish_config_draft_request, opts = {}) data, _status_code, _headers = publish_config_draft_with_http_info(id, publish_config_draft_request, opts) data end |
#publish_config_draft_with_http_info(id, publish_config_draft_request, opts = {}) ⇒ Array<(PublishConfigDraftResponse, Integer, Hash)>
Publish a draft Promotes the staged draft on one env to a new published version. The draft must still validate against the current schema. Returns `404` if there is no draft for the given env. Use case: Ship a staged change once you've validated it on a lower env.
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 468 def publish_config_draft_with_http_info(id, publish_config_draft_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.publish_config_draft ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.publish_config_draft" end # verify the required parameter 'publish_config_draft_request' is set if @api_client.config.client_side_validation && publish_config_draft_request.nil? fail ArgumentError, "Missing the required parameter 'publish_config_draft_request' when calling ConfigsApi.publish_config_draft" end # resource path local_var_path = '/api/admin/configs/{id}/publish'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_config_draft_request) # return_type return_type = opts[:debug_return_type] || 'PublishConfigDraftResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.publish_config_draft", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#publish_config_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#save_config_draft(id, save_config_draft_request, opts = {}) ⇒ SaveConfigDraftResponse
Save a draft value
Stages a value for one env without publishing. The draft is validated against the config's current schema and stored alongside the baseVersion it was forked from. Saving over an existing draft overwrites it. Use POST /{id}/publish to promote it to a new published version. Use case: Iterate on a config value on dev without affecting prod — preview in staging, then publish.
533 534 535 536 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 533 def save_config_draft(id, save_config_draft_request, opts = {}) data, _status_code, _headers = save_config_draft_with_http_info(id, save_config_draft_request, opts) data end |
#save_config_draft_with_http_info(id, save_config_draft_request, opts = {}) ⇒ Array<(SaveConfigDraftResponse, Integer, Hash)>
Save a draft value Stages a value for one env without publishing. The draft is validated against the config's current schema and stored alongside the `baseVersion` it was forked from. Saving over an existing draft overwrites it. Use `POST /id/publish` to promote it to a new published version. Use case: Iterate on a config value on dev without affecting prod — preview in staging, then publish.
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 545 def save_config_draft_with_http_info(id, save_config_draft_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.save_config_draft ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.save_config_draft" end # verify the required parameter 'save_config_draft_request' is set if @api_client.config.client_side_validation && save_config_draft_request.nil? fail ArgumentError, "Missing the required parameter 'save_config_draft_request' when calling ConfigsApi.save_config_draft" end # resource path local_var_path = '/api/admin/configs/{id}/drafts'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(save_config_draft_request) # return_type return_type = opts[:debug_return_type] || 'SaveConfigDraftResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.save_config_draft", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#save_config_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_config(id, update_config_request, opts = {}) ⇒ UpdateConfigResponse
Update a dynamic config
Partial update. When value is supplied it is republished on every env (new version per env). When schema is supplied it replaces the current schema; every existing value is re-validated. For env-scoped edits, use the draft/publish flow (PUT /{id}/drafts then POST /{id}/publish) instead. Use cases - Republish flat value — { \"value\": {…} } sets the same value on every env. - Schema migration — { \"schema\": {…} } replaces the schema; existing values are re-validated. - Env-scoped edits — use PUT /{id}/drafts + POST /{id}/publish instead of PATCH.
610 611 612 613 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 610 def update_config(id, update_config_request, opts = {}) data, _status_code, _headers = update_config_with_http_info(id, update_config_request, opts) data end |
#update_config_schema(id, update_config_schema_request, opts = {}) ⇒ UpdateConfigSchemaResponse
Update a config schema Replaces a config's JSON Schema in place. Every existing published value is re-validated against the new schema before it lands; the update fails if any value no longer validates. Use case: Evolve a config's shape (add/remove a field) without republishing values.
687 688 689 690 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 687 def update_config_schema(id, update_config_schema_request, opts = {}) data, _status_code, _headers = update_config_schema_with_http_info(id, update_config_schema_request, opts) data end |
#update_config_schema_with_http_info(id, update_config_schema_request, opts = {}) ⇒ Array<(UpdateConfigSchemaResponse, Integer, Hash)>
Update a config schema Replaces a config's JSON Schema in place. Every existing published value is re-validated against the new schema before it lands; the update fails if any value no longer validates. Use case: Evolve a config's shape (add/remove a field) without republishing values.
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 699 def update_config_schema_with_http_info(id, update_config_schema_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.update_config_schema ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.update_config_schema" end # verify the required parameter 'update_config_schema_request' is set if @api_client.config.client_side_validation && update_config_schema_request.nil? fail ArgumentError, "Missing the required parameter 'update_config_schema_request' when calling ConfigsApi.update_config_schema" end # resource path local_var_path = '/api/admin/configs/{id}/schema'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_config_schema_request) # return_type return_type = opts[:debug_return_type] || 'UpdateConfigSchemaResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.update_config_schema", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#update_config_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_config_with_http_info(id, update_config_request, opts = {}) ⇒ Array<(UpdateConfigResponse, Integer, Hash)>
Update a dynamic config Partial update. When `value` is supplied it is republished on every env (new version per env). When `schema` is supplied it replaces the current schema; every existing value is re-validated. For env-scoped edits, use the draft/publish flow (`PUT /id/drafts` then `POST /id/publish`) instead. Use cases - Republish flat value — `{ "value": … }` sets the same value on every env. - Schema migration — `{ "schema": … }` replaces the schema; existing values are re-validated. - Env-scoped edits — use `PUT /id/drafts` + `POST /id/publish` instead of PATCH.
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 |
# File 'lib/shipeasy_admin/api/configs_api.rb', line 622 def update_config_with_http_info(id, update_config_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConfigsApi.update_config ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.update_config" end # verify the required parameter 'update_config_request' is set if @api_client.config.client_side_validation && update_config_request.nil? fail ArgumentError, "Missing the required parameter 'update_config_request' when calling ConfigsApi.update_config" end # resource path local_var_path = '/api/admin/configs/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_config_request) # return_type return_type = opts[:debug_return_type] || 'UpdateConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"ConfigsApi.update_config", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConfigsApi#update_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |