shipeasy-sdk 3.8.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/docs/skill/SKILL.md +7 -4
  3. data/lib/shipeasy/admin.rb +23 -20
  4. data/lib/shipeasy/sdk/see.rb +7 -5
  5. data/lib/shipeasy/sdk/version.rb +1 -1
  6. data/lib/shipeasy_admin/api/flags_api.rb +127 -214
  7. data/lib/shipeasy_admin/api/killswitch_api.rb +25 -525
  8. data/lib/shipeasy_admin/api/ops_api.rb +44 -351
  9. data/lib/shipeasy_admin/api_client.rb +2 -2
  10. data/lib/shipeasy_admin/api_error.rb +2 -2
  11. data/lib/shipeasy_admin/api_model_base.rb +2 -2
  12. data/lib/shipeasy_admin/configuration.rb +29 -2
  13. data/lib/shipeasy_admin/models/{set_killswitch_value_request.rb → add_to_gate_whitelist_request.rb} +37 -42
  14. data/lib/shipeasy_admin/models/create_public_bug_request.rb +464 -0
  15. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +407 -0
  16. data/lib/shipeasy_admin/models/{file_error_ticket_response.rb → create_public_ticket_response.rb} +22 -29
  17. data/lib/shipeasy_admin/models/env.rb +2 -2
  18. data/lib/shipeasy_admin/models/error.rb +41 -7
  19. data/lib/shipeasy_admin/models/error_code.rb +14 -3
  20. data/lib/shipeasy_admin/models/{get_experiment_timeseries_response_experiment.rb → gate_whitelist.rb} +51 -42
  21. data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +40 -0
  22. data/lib/shipeasy_admin/models/killswitch_value.rb +2 -2
  23. data/lib/shipeasy_admin/models/notification_target.rb +2 -2
  24. data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +2 -2
  25. data/lib/shipeasy_admin/models/ops_item_priority.rb +42 -0
  26. data/lib/shipeasy_admin/models/ops_item_status.rb +46 -0
  27. data/lib/shipeasy_admin/models/{discard_config_draft_request.rb → remove_from_gate_whitelist_request.rb} +34 -44
  28. data/lib/shipeasy_admin/models/{delete_alert_rule_response.rb → set_gate_whitelist_request.rb} +37 -25
  29. data/lib/shipeasy_admin/models/{set_killswitch_switch_request.rb → toggle_killswitch_request.rb} +30 -72
  30. data/lib/shipeasy_admin/models/{set_killswitch_value_response.rb → toggle_killswitch_response.rb} +100 -6
  31. data/lib/shipeasy_admin/version.rb +2 -2
  32. data/lib/shipeasy_admin.rb +14 -195
  33. metadata +13 -194
  34. data/lib/shipeasy_admin/api/alerts_api.rb +0 -352
  35. data/lib/shipeasy_admin/api/api_keys_api.rb +0 -229
  36. data/lib/shipeasy_admin/api/attributes_api.rb +0 -82
  37. data/lib/shipeasy_admin/api/configs_api.rb +0 -757
  38. data/lib/shipeasy_admin/api/connectors_api.rb +0 -497
  39. data/lib/shipeasy_admin/api/drafts_api.rb +0 -82
  40. data/lib/shipeasy_admin/api/errors_api.rb +0 -389
  41. data/lib/shipeasy_admin/api/events_api.rb +0 -438
  42. data/lib/shipeasy_admin/api/experiments_api.rb +0 -727
  43. data/lib/shipeasy_admin/api/keys_api.rb +0 -317
  44. data/lib/shipeasy_admin/api/metrics_api.rb +0 -281
  45. data/lib/shipeasy_admin/api/profiles_api.rb +0 -222
  46. data/lib/shipeasy_admin/api/projects_api.rb +0 -216
  47. data/lib/shipeasy_admin/api/universes_api.rb +0 -306
  48. data/lib/shipeasy_admin/models/approve_event_request.rb +0 -198
  49. data/lib/shipeasy_admin/models/approve_event_response.rb +0 -166
  50. data/lib/shipeasy_admin/models/claude_trigger_config.rb +0 -204
  51. data/lib/shipeasy_admin/models/connector_event.rb +0 -40
  52. data/lib/shipeasy_admin/models/connector_provider.rb +0 -45
  53. data/lib/shipeasy_admin/models/connector_record.rb +0 -468
  54. data/lib/shipeasy_admin/models/copilot_trigger_config.rb +0 -276
  55. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +0 -383
  56. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +0 -165
  57. data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +0 -309
  58. data/lib/shipeasy_admin/models/create_config_request.rb +0 -291
  59. data/lib/shipeasy_admin/models/create_config_response.rb +0 -201
  60. data/lib/shipeasy_admin/models/create_connector_request.rb +0 -64
  61. data/lib/shipeasy_admin/models/create_connector_response.rb +0 -165
  62. data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +0 -316
  63. data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +0 -352
  64. data/lib/shipeasy_admin/models/create_event_request.rb +0 -236
  65. data/lib/shipeasy_admin/models/create_event_response.rb +0 -193
  66. data/lib/shipeasy_admin/models/create_experiment_request.rb +0 -807
  67. data/lib/shipeasy_admin/models/create_experiment_response.rb +0 -212
  68. data/lib/shipeasy_admin/models/create_gate_request.rb +0 -492
  69. data/lib/shipeasy_admin/models/create_gate_response.rb +0 -212
  70. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +0 -188
  71. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +0 -193
  72. data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +0 -352
  73. data/lib/shipeasy_admin/models/create_key_request.rb +0 -297
  74. data/lib/shipeasy_admin/models/create_key_response.rb +0 -286
  75. data/lib/shipeasy_admin/models/create_killswitch_request.rb +0 -274
  76. data/lib/shipeasy_admin/models/create_killswitch_response.rb +0 -201
  77. data/lib/shipeasy_admin/models/create_metric_request.rb +0 -403
  78. data/lib/shipeasy_admin/models/create_metric_response.rb +0 -193
  79. data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +0 -273
  80. data/lib/shipeasy_admin/models/create_ops_item_request.rb +0 -287
  81. data/lib/shipeasy_admin/models/create_ops_item_response.rb +0 -177
  82. data/lib/shipeasy_admin/models/create_universe_request.rb +0 -272
  83. data/lib/shipeasy_admin/models/create_universe_response.rb +0 -212
  84. data/lib/shipeasy_admin/models/cursor_trigger_config.rb +0 -231
  85. data/lib/shipeasy_admin/models/delete_config_response.rb +0 -188
  86. data/lib/shipeasy_admin/models/delete_connector_response.rb +0 -188
  87. data/lib/shipeasy_admin/models/delete_event_response.rb +0 -189
  88. data/lib/shipeasy_admin/models/delete_experiment_response.rb +0 -188
  89. data/lib/shipeasy_admin/models/delete_gate_response.rb +0 -188
  90. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +0 -188
  91. data/lib/shipeasy_admin/models/delete_metric_response.rb +0 -189
  92. data/lib/shipeasy_admin/models/delete_universe_response.rb +0 -188
  93. data/lib/shipeasy_admin/models/disable_gate_response.rb +0 -190
  94. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +0 -188
  95. data/lib/shipeasy_admin/models/enable_gate_response.rb +0 -190
  96. data/lib/shipeasy_admin/models/error_record.rb +0 -597
  97. data/lib/shipeasy_admin/models/error_series_request.rb +0 -251
  98. data/lib/shipeasy_admin/models/error_series_response.rb +0 -195
  99. data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +0 -192
  100. data/lib/shipeasy_admin/models/experiment_inline_metric.rb +0 -337
  101. data/lib/shipeasy_admin/models/fire_connector_request.rb +0 -149
  102. data/lib/shipeasy_admin/models/fire_connector_response.rb +0 -176
  103. data/lib/shipeasy_admin/models/get_config_response.rb +0 -351
  104. data/lib/shipeasy_admin/models/get_current_project_response.rb +0 -606
  105. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +0 -104
  106. data/lib/shipeasy_admin/models/get_event_response.rb +0 -344
  107. data/lib/shipeasy_admin/models/get_experiment_response.rb +0 -688
  108. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +0 -243
  109. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +0 -248
  110. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +0 -252
  111. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +0 -192
  112. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +0 -278
  113. data/lib/shipeasy_admin/models/get_killswitch_response.rb +0 -270
  114. data/lib/shipeasy_admin/models/get_metric_response.rb +0 -378
  115. data/lib/shipeasy_admin/models/get_ops_item_response.rb +0 -349
  116. data/lib/shipeasy_admin/models/jules_trigger_config.rb +0 -240
  117. data/lib/shipeasy_admin/models/key_record.rb +0 -353
  118. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +0 -186
  119. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +0 -166
  120. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +0 -478
  121. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +0 -176
  122. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +0 -280
  123. data/lib/shipeasy_admin/models/list_configs_response.rb +0 -178
  124. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +0 -351
  125. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +0 -237
  126. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +0 -237
  127. data/lib/shipeasy_admin/models/list_events_response_inner.rb +0 -344
  128. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +0 -259
  129. data/lib/shipeasy_admin/models/list_experiments_response.rb +0 -178
  130. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +0 -688
  131. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +0 -241
  132. data/lib/shipeasy_admin/models/list_gates_response.rb +0 -178
  133. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +0 -395
  134. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +0 -104
  135. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +0 -238
  136. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +0 -105
  137. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +0 -358
  138. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +0 -331
  139. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +0 -319
  140. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +0 -272
  141. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +0 -195
  142. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +0 -274
  143. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +0 -224
  144. data/lib/shipeasy_admin/models/list_keys_response.rb +0 -180
  145. data/lib/shipeasy_admin/models/list_killswitches_response.rb +0 -178
  146. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +0 -270
  147. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +0 -248
  148. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +0 -378
  149. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +0 -288
  150. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +0 -113
  151. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +0 -188
  152. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +0 -188
  153. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +0 -188
  154. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +0 -188
  155. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +0 -188
  156. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +0 -188
  157. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +0 -188
  158. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +0 -217
  159. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +0 -233
  160. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +0 -240
  161. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +0 -266
  162. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +0 -264
  163. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +0 -228
  164. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +0 -349
  165. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +0 -195
  166. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +0 -203
  167. data/lib/shipeasy_admin/models/list_universes_response.rb +0 -178
  168. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +0 -305
  169. data/lib/shipeasy_admin/models/notify_ops_request.rb +0 -261
  170. data/lib/shipeasy_admin/models/notify_ops_response.rb +0 -193
  171. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +0 -187
  172. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +0 -257
  173. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +0 -391
  174. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +0 -195
  175. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +0 -192
  176. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +0 -251
  177. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +0 -214
  178. data/lib/shipeasy_admin/models/revoke_key_response.rb +0 -216
  179. data/lib/shipeasy_admin/models/save_config_draft_request.rb +0 -199
  180. data/lib/shipeasy_admin/models/save_config_draft_response.rb +0 -283
  181. data/lib/shipeasy_admin/models/search_hit.rb +0 -284
  182. data/lib/shipeasy_admin/models/search_response.rb +0 -167
  183. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +0 -168
  184. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +0 -216
  185. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +0 -179
  186. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +0 -201
  187. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +0 -190
  188. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +0 -214
  189. data/lib/shipeasy_admin/models/set_i18n_label_request.rb +0 -213
  190. data/lib/shipeasy_admin/models/set_i18n_label_response.rb +0 -472
  191. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +0 -285
  192. data/lib/shipeasy_admin/models/test_connector_response.rb +0 -189
  193. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +0 -234
  194. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +0 -286
  195. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +0 -304
  196. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +0 -165
  197. data/lib/shipeasy_admin/models/update_config_request.rb +0 -198
  198. data/lib/shipeasy_admin/models/update_config_response.rb +0 -165
  199. data/lib/shipeasy_admin/models/update_config_schema_request.rb +0 -168
  200. data/lib/shipeasy_admin/models/update_config_schema_response.rb +0 -165
  201. data/lib/shipeasy_admin/models/update_connector_request.rb +0 -211
  202. data/lib/shipeasy_admin/models/update_connector_response.rb +0 -166
  203. data/lib/shipeasy_admin/models/update_error_status_request.rb +0 -190
  204. data/lib/shipeasy_admin/models/update_event_request.rb +0 -198
  205. data/lib/shipeasy_admin/models/update_event_response.rb +0 -166
  206. data/lib/shipeasy_admin/models/update_experiment_request.rb +0 -747
  207. data/lib/shipeasy_admin/models/update_experiment_response.rb +0 -165
  208. data/lib/shipeasy_admin/models/update_gate_request.rb +0 -403
  209. data/lib/shipeasy_admin/models/update_gate_response.rb +0 -166
  210. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +0 -176
  211. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +0 -166
  212. data/lib/shipeasy_admin/models/update_killswitch_request.rb +0 -224
  213. data/lib/shipeasy_admin/models/update_killswitch_response.rb +0 -165
  214. data/lib/shipeasy_admin/models/update_ops_item_request.rb +0 -205
  215. data/lib/shipeasy_admin/models/update_ops_item_response.rb +0 -166
  216. data/lib/shipeasy_admin/models/update_universe_request.rb +0 -213
  217. data/lib/shipeasy_admin/models/update_universe_response.rb +0 -165
  218. data/lib/shipeasy_admin/models/upsert_project_request.rb +0 -222
  219. data/lib/shipeasy_admin/models/upsert_project_response.rb +0 -260
@@ -1,306 +0,0 @@
1
- =begin
2
- #Shipeasy Admin API
3
-
4
- #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.23.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Shipeasy::Admin::Generated
16
- class UniversesApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Create a universe
23
- # Creates a new universe. Only `name` is required — `unit_type` defaults to `user_id` and `holdout_range` defaults to `null` (no holdout). Returns `409` if `name` already exists in the project. Returns `403` if you supply `holdout_range` on a plan below Pro. **Use cases** - **Default universe** — `{ \"name\": \"primary_users\" }`. Per-user randomisation, no holdout. - **Reserved holdout** — supply `holdout_range` to carve out a measurement slice excluded from all experiments. - **Account-level** — `unit_type: 'account_id'` so multi-seat accounts see one consistent variant.
24
- # @param create_universe_request [CreateUniverseRequest]
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
27
- # @return [CreateUniverseResponse]
28
- def create_universe(create_universe_request, opts = {})
29
- data, _status_code, _headers = create_universe_with_http_info(create_universe_request, opts)
30
- data
31
- end
32
-
33
- # Create a universe
34
- # Creates a new universe. Only `name` is required — `unit_type` defaults to `user_id` and `holdout_range` defaults to `null` (no holdout). Returns `409` if `name` already exists in the project. Returns `403` if you supply `holdout_range` on a plan below Pro. **Use cases** - **Default universe** — `{ \"name\": \"primary_users\" }`. Per-user randomisation, no holdout. - **Reserved holdout** — supply `holdout_range` to carve out a measurement slice excluded from all experiments. - **Account-level** — `unit_type: 'account_id'` so multi-seat accounts see one consistent variant.
35
- # @param create_universe_request [CreateUniverseRequest]
36
- # @param [Hash] opts the optional parameters
37
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
38
- # @return [Array<(CreateUniverseResponse, Integer, Hash)>] CreateUniverseResponse data, response status code and response headers
39
- def create_universe_with_http_info(create_universe_request, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: UniversesApi.create_universe ...'
42
- end
43
- # verify the required parameter 'create_universe_request' is set
44
- if @api_client.config.client_side_validation && create_universe_request.nil?
45
- fail ArgumentError, "Missing the required parameter 'create_universe_request' when calling UniversesApi.create_universe"
46
- end
47
- # resource path
48
- local_var_path = '/api/admin/universes'
49
-
50
- # query parameters
51
- query_params = opts[:query_params] || {}
52
-
53
- # header parameters
54
- header_params = opts[:header_params] || {}
55
- # HTTP header 'Accept' (if needed)
56
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
- # HTTP header 'Content-Type'
58
- content_type = @api_client.select_header_content_type(['application/json'])
59
- if !content_type.nil?
60
- header_params['Content-Type'] = content_type
61
- end
62
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
63
-
64
- # form parameters
65
- form_params = opts[:form_params] || {}
66
-
67
- # http body (model)
68
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_universe_request)
69
-
70
- # return_type
71
- return_type = opts[:debug_return_type] || 'CreateUniverseResponse'
72
-
73
- # auth_names
74
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
75
-
76
- new_options = opts.merge(
77
- :operation => :"UniversesApi.create_universe",
78
- :header_params => header_params,
79
- :query_params => query_params,
80
- :form_params => form_params,
81
- :body => post_body,
82
- :auth_names => auth_names,
83
- :return_type => return_type
84
- )
85
-
86
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
- if @api_client.config.debugging
88
- @api_client.config.logger.debug "API called: UniversesApi#create_universe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
- # Delete a universe
94
- # Soft-deletes the universe. Returns `409` if any non-archived experiment still references it — archive those experiments first. **Use case:** Tear down a universe after every experiment that used it has been archived.
95
- # @param id [String] Stable opaque universe id (&#x60;uni_…&#x60;) or the universe&#39;s &#x60;name&#x60;.
96
- # @param [Hash] opts the optional parameters
97
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
98
- # @return [DeleteUniverseResponse]
99
- def delete_universe(id, opts = {})
100
- data, _status_code, _headers = delete_universe_with_http_info(id, opts)
101
- data
102
- end
103
-
104
- # Delete a universe
105
- # Soft-deletes the universe. Returns &#x60;409&#x60; if any non-archived experiment still references it — archive those experiments first. **Use case:** Tear down a universe after every experiment that used it has been archived.
106
- # @param id [String] Stable opaque universe id (&#x60;uni_…&#x60;) or the universe&#39;s &#x60;name&#x60;.
107
- # @param [Hash] opts the optional parameters
108
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
109
- # @return [Array<(DeleteUniverseResponse, Integer, Hash)>] DeleteUniverseResponse data, response status code and response headers
110
- def delete_universe_with_http_info(id, opts = {})
111
- if @api_client.config.debugging
112
- @api_client.config.logger.debug 'Calling API: UniversesApi.delete_universe ...'
113
- end
114
- # resource path
115
- local_var_path = '/api/admin/universes/{id}'.sub('{id}', CGI.escape(id.to_s))
116
-
117
- # query parameters
118
- query_params = opts[:query_params] || {}
119
-
120
- # header parameters
121
- header_params = opts[:header_params] || {}
122
- # HTTP header 'Accept' (if needed)
123
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
124
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
125
-
126
- # form parameters
127
- form_params = opts[:form_params] || {}
128
-
129
- # http body (model)
130
- post_body = opts[:debug_body]
131
-
132
- # return_type
133
- return_type = opts[:debug_return_type] || 'DeleteUniverseResponse'
134
-
135
- # auth_names
136
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
137
-
138
- new_options = opts.merge(
139
- :operation => :"UniversesApi.delete_universe",
140
- :header_params => header_params,
141
- :query_params => query_params,
142
- :form_params => form_params,
143
- :body => post_body,
144
- :auth_names => auth_names,
145
- :return_type => return_type
146
- )
147
-
148
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
149
- if @api_client.config.debugging
150
- @api_client.config.logger.debug "API called: UniversesApi#delete_universe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
- end
152
- return data, status_code, headers
153
- end
154
-
155
- # List universes
156
- # Returns a single page of universes ordered by `created_at desc, id desc`. The universes table has no `updated_at`, so this list is keyed on creation time. **Use case:** Snapshot every universe in the project — for example to audit which `unit_type` and `holdout_range` are in use before launching a new experiment.
157
- # @param [Hash] opts the optional parameters
158
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
159
- # @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
160
- # @option opts [String] :cursor Opaque cursor returned in the previous page&#39;s &#x60;next_cursor&#x60;. Omit for the first page.
161
- # @return [ListUniversesResponse]
162
- def list_universes(opts = {})
163
- data, _status_code, _headers = list_universes_with_http_info(opts)
164
- data
165
- end
166
-
167
- # List universes
168
- # Returns a single page of universes ordered by &#x60;created_at desc, id desc&#x60;. The universes table has no &#x60;updated_at&#x60;, so this list is keyed on creation time. **Use case:** Snapshot every universe in the project — for example to audit which &#x60;unit_type&#x60; and &#x60;holdout_range&#x60; are in use before launching a new experiment.
169
- # @param [Hash] opts the optional parameters
170
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
171
- # @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
172
- # @option opts [String] :cursor Opaque cursor returned in the previous page&#39;s &#x60;next_cursor&#x60;. Omit for the first page.
173
- # @return [Array<(ListUniversesResponse, Integer, Hash)>] ListUniversesResponse data, response status code and response headers
174
- def list_universes_with_http_info(opts = {})
175
- if @api_client.config.debugging
176
- @api_client.config.logger.debug 'Calling API: UniversesApi.list_universes ...'
177
- end
178
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
179
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UniversesApi.list_universes, must be smaller than or equal to 500.'
180
- end
181
-
182
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
183
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UniversesApi.list_universes, must be greater than or equal to 1.'
184
- end
185
-
186
- # resource path
187
- local_var_path = '/api/admin/universes'
188
-
189
- # query parameters
190
- query_params = opts[:query_params] || {}
191
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
192
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
193
-
194
- # header parameters
195
- header_params = opts[:header_params] || {}
196
- # HTTP header 'Accept' (if needed)
197
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
198
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
199
-
200
- # form parameters
201
- form_params = opts[:form_params] || {}
202
-
203
- # http body (model)
204
- post_body = opts[:debug_body]
205
-
206
- # return_type
207
- return_type = opts[:debug_return_type] || 'ListUniversesResponse'
208
-
209
- # auth_names
210
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
211
-
212
- new_options = opts.merge(
213
- :operation => :"UniversesApi.list_universes",
214
- :header_params => header_params,
215
- :query_params => query_params,
216
- :form_params => form_params,
217
- :body => post_body,
218
- :auth_names => auth_names,
219
- :return_type => return_type
220
- )
221
-
222
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
223
- if @api_client.config.debugging
224
- @api_client.config.logger.debug "API called: UniversesApi#list_universes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
- end
226
- return data, status_code, headers
227
- end
228
-
229
- # Update a universe
230
- # Partial update. Only `holdout_range` is mutable — `name` and `unit_type` are immutable after create. Pass `\"holdout_range\": null` to remove an existing holdout. **Use cases** - **Adjust holdout** — change the reserved measurement slice without recreating experiments. - **Remove holdout** — `{ \"holdout_range\": null }`.
231
- # @param id [String] Stable opaque universe id (&#x60;uni_…&#x60;) or the universe&#39;s &#x60;name&#x60;.
232
- # @param update_universe_request [UpdateUniverseRequest]
233
- # @param [Hash] opts the optional parameters
234
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
235
- # @return [UpdateUniverseResponse]
236
- def update_universe(id, update_universe_request, opts = {})
237
- data, _status_code, _headers = update_universe_with_http_info(id, update_universe_request, opts)
238
- data
239
- end
240
-
241
- # Update a universe
242
- # Partial update. Only &#x60;holdout_range&#x60; is mutable — &#x60;name&#x60; and &#x60;unit_type&#x60; are immutable after create. Pass &#x60;\&quot;holdout_range\&quot;: null&#x60; to remove an existing holdout. **Use cases** - **Adjust holdout** — change the reserved measurement slice without recreating experiments. - **Remove holdout** — &#x60;{ \&quot;holdout_range\&quot;: null }&#x60;.
243
- # @param id [String] Stable opaque universe id (&#x60;uni_…&#x60;) or the universe&#39;s &#x60;name&#x60;.
244
- # @param update_universe_request [UpdateUniverseRequest]
245
- # @param [Hash] opts the optional parameters
246
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
247
- # @return [Array<(UpdateUniverseResponse, Integer, Hash)>] UpdateUniverseResponse data, response status code and response headers
248
- def update_universe_with_http_info(id, update_universe_request, opts = {})
249
- if @api_client.config.debugging
250
- @api_client.config.logger.debug 'Calling API: UniversesApi.update_universe ...'
251
- end
252
- # verify the required parameter 'id' is set
253
- if @api_client.config.client_side_validation && id.nil?
254
- fail ArgumentError, "Missing the required parameter 'id' when calling UniversesApi.update_universe"
255
- end
256
- # verify the required parameter 'update_universe_request' is set
257
- if @api_client.config.client_side_validation && update_universe_request.nil?
258
- fail ArgumentError, "Missing the required parameter 'update_universe_request' when calling UniversesApi.update_universe"
259
- end
260
- # resource path
261
- local_var_path = '/api/admin/universes/{id}'.sub('{id}', CGI.escape(id.to_s))
262
-
263
- # query parameters
264
- query_params = opts[:query_params] || {}
265
-
266
- # header parameters
267
- header_params = opts[:header_params] || {}
268
- # HTTP header 'Accept' (if needed)
269
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
270
- # HTTP header 'Content-Type'
271
- content_type = @api_client.select_header_content_type(['application/json'])
272
- if !content_type.nil?
273
- header_params['Content-Type'] = content_type
274
- end
275
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
276
-
277
- # form parameters
278
- form_params = opts[:form_params] || {}
279
-
280
- # http body (model)
281
- post_body = opts[:debug_body] || @api_client.object_to_http_body(update_universe_request)
282
-
283
- # return_type
284
- return_type = opts[:debug_return_type] || 'UpdateUniverseResponse'
285
-
286
- # auth_names
287
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
288
-
289
- new_options = opts.merge(
290
- :operation => :"UniversesApi.update_universe",
291
- :header_params => header_params,
292
- :query_params => query_params,
293
- :form_params => form_params,
294
- :body => post_body,
295
- :auth_names => auth_names,
296
- :return_type => return_type
297
- )
298
-
299
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
300
- if @api_client.config.debugging
301
- @api_client.config.logger.debug "API called: UniversesApi#update_universe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
302
- end
303
- return data, status_code, headers
304
- end
305
- end
306
- end
@@ -1,198 +0,0 @@
1
- =begin
2
- #Shipeasy Admin API
3
-
4
- #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.23.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Shipeasy::Admin::Generated
17
- # Body for `PATCH /api/admin/events/{id}` and `POST /api/admin/events/{id}/approve`. All fields optional; `name` is immutable after create.
18
- class ApproveEventRequest < ApiModelBase
19
- # Optional folder name grouping items in the dashboard. Alphanumeric, `_` or `-` (no `/`). Part of the SDK lookup key (`<folder>/<name>`).
20
- attr_accessor :folder
21
-
22
- # New description for the event.
23
- attr_accessor :description
24
-
25
- # Replaces the full property set (no merge). Omit to leave properties unchanged.
26
- attr_accessor :properties
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'folder' => :'folder',
32
- :'description' => :'description',
33
- :'properties' => :'properties'
34
- }
35
- end
36
-
37
- # Returns attribute mapping this model knows about
38
- def self.acceptable_attribute_map
39
- attribute_map
40
- end
41
-
42
- # Returns all the JSON keys this model knows about
43
- def self.acceptable_attributes
44
- acceptable_attribute_map.values
45
- end
46
-
47
- # Attribute type mapping.
48
- def self.openapi_types
49
- {
50
- :'folder' => :'String',
51
- :'description' => :'String',
52
- :'properties' => :'Array<ListEventsResponseInnerPropertiesInner>'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- :'folder',
60
- ])
61
- end
62
-
63
- # Initializes the object
64
- # @param [Hash] attributes Model attributes in the form of hash
65
- def initialize(attributes = {})
66
- if (!attributes.is_a?(Hash))
67
- fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ApproveEventRequest` initialize method"
68
- end
69
-
70
- # check to see if the attribute exists and convert string to symbol for hash key
71
- acceptable_attribute_map = self.class.acceptable_attribute_map
72
- attributes = attributes.each_with_object({}) { |(k, v), h|
73
- if (!acceptable_attribute_map.key?(k.to_sym))
74
- fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::ApproveEventRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
- end
76
- h[k.to_sym] = v
77
- }
78
-
79
- if attributes.key?(:'folder')
80
- self.folder = attributes[:'folder']
81
- end
82
-
83
- if attributes.key?(:'description')
84
- self.description = attributes[:'description']
85
- end
86
-
87
- if attributes.key?(:'properties')
88
- if (value = attributes[:'properties']).is_a?(Array)
89
- self.properties = value
90
- end
91
- end
92
- end
93
-
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
- invalid_properties = Array.new
99
- if !@folder.nil? && @folder.to_s.length > 256
100
- invalid_properties.push('invalid value for "folder", the character length must be smaller than or equal to 256.')
101
- end
102
-
103
- pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
104
- if !@folder.nil? && @folder !~ pattern
105
- invalid_properties.push("invalid value for \"folder\", must conform to the pattern #{pattern}.")
106
- end
107
-
108
- invalid_properties
109
- end
110
-
111
- # Check to see if the all the properties in the model are valid
112
- # @return true if the model is valid
113
- def valid?
114
- warn '[DEPRECATED] the `valid?` method is obsolete'
115
- return false if !@folder.nil? && @folder.to_s.length > 256
116
- return false if !@folder.nil? && @folder !~ Regexp.new(/^[a-zA-Z0-9_-]+$/)
117
- true
118
- end
119
-
120
- # Custom attribute writer method with validation
121
- # @param [Object] folder Value to be assigned
122
- def folder=(folder)
123
- if !folder.nil? && folder.to_s.length > 256
124
- fail ArgumentError, 'invalid value for "folder", the character length must be smaller than or equal to 256.'
125
- end
126
-
127
- pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
128
- if !folder.nil? && folder !~ pattern
129
- fail ArgumentError, "invalid value for \"folder\", must conform to the pattern #{pattern}."
130
- end
131
-
132
- @folder = folder
133
- end
134
-
135
- # Checks equality by comparing each attribute.
136
- # @param [Object] Object to be compared
137
- def ==(o)
138
- return true if self.equal?(o)
139
- self.class == o.class &&
140
- folder == o.folder &&
141
- description == o.description &&
142
- properties == o.properties
143
- end
144
-
145
- # @see the `==` method
146
- # @param [Object] Object to be compared
147
- def eql?(o)
148
- self == o
149
- end
150
-
151
- # Calculates hash code according to all attributes.
152
- # @return [Integer] Hash code
153
- def hash
154
- [folder, description, properties].hash
155
- end
156
-
157
- # Builds the object from hash
158
- # @param [Hash] attributes Model attributes in the form of hash
159
- # @return [Object] Returns the model itself
160
- def self.build_from_hash(attributes)
161
- return nil unless attributes.is_a?(Hash)
162
- attributes = attributes.transform_keys(&:to_sym)
163
- transformed_hash = {}
164
- openapi_types.each_pair do |key, type|
165
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
- transformed_hash["#{key}"] = nil
167
- elsif type =~ /\AArray<(.*)>/i
168
- # check to ensure the input is an array given that the attribute
169
- # is documented as an array but the input is not
170
- if attributes[attribute_map[key]].is_a?(Array)
171
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
- end
173
- elsif !attributes[attribute_map[key]].nil?
174
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
- end
176
- end
177
- new(transformed_hash)
178
- end
179
-
180
- # Returns the object in the form of hash
181
- # @return [Hash] Returns the object in the form of hash
182
- def to_hash
183
- hash = {}
184
- self.class.attribute_map.each_pair do |attr, param|
185
- value = self.send(attr)
186
- if value.nil?
187
- is_nullable = self.class.openapi_nullable.include?(attr)
188
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
- end
190
-
191
- hash[param] = _to_hash(value)
192
- end
193
- hash
194
- end
195
-
196
- end
197
-
198
- end
@@ -1,166 +0,0 @@
1
- =begin
2
- #Shipeasy Admin API
3
-
4
- #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.23.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Shipeasy::Admin::Generated
17
- # Result of updating or approving an event.
18
- class ApproveEventResponse < ApiModelBase
19
- # Event id that was updated.
20
- attr_accessor :id
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'id' => :'id'
26
- }
27
- end
28
-
29
- # Returns attribute mapping this model knows about
30
- def self.acceptable_attribute_map
31
- attribute_map
32
- end
33
-
34
- # Returns all the JSON keys this model knows about
35
- def self.acceptable_attributes
36
- acceptable_attribute_map.values
37
- end
38
-
39
- # Attribute type mapping.
40
- def self.openapi_types
41
- {
42
- :'id' => :'String'
43
- }
44
- end
45
-
46
- # List of attributes with nullable: true
47
- def self.openapi_nullable
48
- Set.new([
49
- ])
50
- end
51
-
52
- # Initializes the object
53
- # @param [Hash] attributes Model attributes in the form of hash
54
- def initialize(attributes = {})
55
- if (!attributes.is_a?(Hash))
56
- fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ApproveEventResponse` initialize method"
57
- end
58
-
59
- # check to see if the attribute exists and convert string to symbol for hash key
60
- acceptable_attribute_map = self.class.acceptable_attribute_map
61
- attributes = attributes.each_with_object({}) { |(k, v), h|
62
- if (!acceptable_attribute_map.key?(k.to_sym))
63
- fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::ApproveEventResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
- end
65
- h[k.to_sym] = v
66
- }
67
-
68
- if attributes.key?(:'id')
69
- self.id = attributes[:'id']
70
- else
71
- self.id = nil
72
- end
73
- end
74
-
75
- # Show invalid properties with the reasons. Usually used together with valid?
76
- # @return Array for valid properties with the reasons
77
- def list_invalid_properties
78
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
- invalid_properties = Array.new
80
- if @id.nil?
81
- invalid_properties.push('invalid value for "id", id cannot be nil.')
82
- end
83
-
84
- invalid_properties
85
- end
86
-
87
- # Check to see if the all the properties in the model are valid
88
- # @return true if the model is valid
89
- def valid?
90
- warn '[DEPRECATED] the `valid?` method is obsolete'
91
- return false if @id.nil?
92
- true
93
- end
94
-
95
- # Custom attribute writer method with validation
96
- # @param [Object] id Value to be assigned
97
- def id=(id)
98
- if id.nil?
99
- fail ArgumentError, 'id cannot be nil'
100
- end
101
-
102
- @id = id
103
- end
104
-
105
- # Checks equality by comparing each attribute.
106
- # @param [Object] Object to be compared
107
- def ==(o)
108
- return true if self.equal?(o)
109
- self.class == o.class &&
110
- id == o.id
111
- end
112
-
113
- # @see the `==` method
114
- # @param [Object] Object to be compared
115
- def eql?(o)
116
- self == o
117
- end
118
-
119
- # Calculates hash code according to all attributes.
120
- # @return [Integer] Hash code
121
- def hash
122
- [id].hash
123
- end
124
-
125
- # Builds the object from hash
126
- # @param [Hash] attributes Model attributes in the form of hash
127
- # @return [Object] Returns the model itself
128
- def self.build_from_hash(attributes)
129
- return nil unless attributes.is_a?(Hash)
130
- attributes = attributes.transform_keys(&:to_sym)
131
- transformed_hash = {}
132
- openapi_types.each_pair do |key, type|
133
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
- transformed_hash["#{key}"] = nil
135
- elsif type =~ /\AArray<(.*)>/i
136
- # check to ensure the input is an array given that the attribute
137
- # is documented as an array but the input is not
138
- if attributes[attribute_map[key]].is_a?(Array)
139
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
- end
141
- elsif !attributes[attribute_map[key]].nil?
142
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
- end
144
- end
145
- new(transformed_hash)
146
- end
147
-
148
- # Returns the object in the form of hash
149
- # @return [Hash] Returns the object in the form of hash
150
- def to_hash
151
- hash = {}
152
- self.class.attribute_map.each_pair do |attr, param|
153
- value = self.send(attr)
154
- if value.nil?
155
- is_nullable = self.class.openapi_nullable.include?(attr)
156
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
- end
158
-
159
- hash[param] = _to_hash(value)
160
- end
161
- hash
162
- end
163
-
164
- end
165
-
166
- end