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,807 +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 `POST /api/admin/experiments`. `name`, `universe`, and `groups` (≥2, weights sum to 10000) required.
18
- class CreateExperimentRequest < ApiModelBase
19
- # Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
20
- attr_accessor :name
21
-
22
- # Free-form description. Max 2000 chars, markdown rendered in the dashboard.
23
- attr_accessor :description
24
-
25
- # Hypothesis statement shown in the editor. Display-only.
26
- attr_accessor :hypothesis
27
-
28
- # Short tag chip rendered next to the name. Display-only.
29
- attr_accessor :tag
30
-
31
- # Owner email. Display-only.
32
- attr_accessor :owner_email
33
-
34
- # Audience label shown in the editor. Display-only.
35
- attr_accessor :audience
36
-
37
- # User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
38
- attr_accessor :bucket_by
39
-
40
- # Optional folder name grouping items in the dashboard. Alphanumeric, `_` or `-` (no `/`). Part of the SDK lookup key (`<folder>/<name>`).
41
- attr_accessor :folder
42
-
43
- # Name of an existing universe in the project. Returns `422` if the universe doesn't exist.
44
- attr_accessor :universe
45
-
46
- # Optional gate name. Only callers that pass the gate are enrolled in the experiment.
47
- attr_accessor :targeting_gate
48
-
49
- # Share of the (gated) audience allocated to the experiment, in basis points (0–10000 = 0%–100%). `0` = unallocated. Use `allocation_percent` (0–100) below to think in percent. Immutable while the experiment is running.
50
- attr_accessor :allocation_pct
51
-
52
- # Allocation as a **percentage** (0–100, fractional ok). Friendlier alias for `allocation_pct`; converted to basis points server-side (e.g. `50` = 5000 bp). If both are set, `allocation_percent` wins.
53
- attr_accessor :allocation_percent
54
-
55
- # Hash salt for bucketing. Auto-generated if omitted. Immutable while running.
56
- attr_accessor :salt
57
-
58
- # Map of param-name → scalar type. Defines the shape of `groups[].params`. Example: `{ headline: 'string', show_cta: 'bool' }`.
59
- attr_accessor :params
60
-
61
- # Two or more variants. Weights must sum to exactly 10000 (100%). Immutable while running.
62
- attr_accessor :groups
63
-
64
- # p-value cutoff used by the analysis pass. Defaults to `0.05`. Values other than 0.05 require Pro plan or higher.
65
- attr_accessor :significance_threshold
66
-
67
- # Minimum days the experiment must run before results are considered conclusive.
68
- attr_accessor :min_runtime_days
69
-
70
- # Minimum exposures per group before results are considered conclusive.
71
- attr_accessor :min_sample_size
72
-
73
- # Enable sequential testing (always-valid p-values). Requires Premium plan or higher.
74
- attr_accessor :sequential_testing
75
-
76
- # Single goal metric defined inline — either a DSL `query` or an `event` (+`aggregation`/`value`) the server compiles. Attaching one is required before the experiment can be started. The underlying event is auto-created if missing.
77
- attr_accessor :goal_metric
78
-
79
- # Up to 10 guardrail metrics defined inline. Each is upserted (event + metric) and attached with role=guardrail.
80
- attr_accessor :guardrail_metrics
81
-
82
- class EnumAttributeValidator
83
- attr_reader :datatype
84
- attr_reader :allowable_values
85
-
86
- def initialize(datatype, allowable_values)
87
- @allowable_values = allowable_values.map do |value|
88
- case datatype.to_s
89
- when /Integer/i
90
- value.to_i
91
- when /Float/i
92
- value.to_f
93
- else
94
- value
95
- end
96
- end
97
- end
98
-
99
- def valid?(value)
100
- !value || allowable_values.include?(value)
101
- end
102
- end
103
-
104
- # Attribute mapping from ruby-style variable name to JSON key.
105
- def self.attribute_map
106
- {
107
- :'name' => :'name',
108
- :'description' => :'description',
109
- :'hypothesis' => :'hypothesis',
110
- :'tag' => :'tag',
111
- :'owner_email' => :'owner_email',
112
- :'audience' => :'audience',
113
- :'bucket_by' => :'bucket_by',
114
- :'folder' => :'folder',
115
- :'universe' => :'universe',
116
- :'targeting_gate' => :'targeting_gate',
117
- :'allocation_pct' => :'allocation_pct',
118
- :'allocation_percent' => :'allocation_percent',
119
- :'salt' => :'salt',
120
- :'params' => :'params',
121
- :'groups' => :'groups',
122
- :'significance_threshold' => :'significance_threshold',
123
- :'min_runtime_days' => :'min_runtime_days',
124
- :'min_sample_size' => :'min_sample_size',
125
- :'sequential_testing' => :'sequential_testing',
126
- :'goal_metric' => :'goal_metric',
127
- :'guardrail_metrics' => :'guardrail_metrics'
128
- }
129
- end
130
-
131
- # Returns attribute mapping this model knows about
132
- def self.acceptable_attribute_map
133
- attribute_map
134
- end
135
-
136
- # Returns all the JSON keys this model knows about
137
- def self.acceptable_attributes
138
- acceptable_attribute_map.values
139
- end
140
-
141
- # Attribute type mapping.
142
- def self.openapi_types
143
- {
144
- :'name' => :'String',
145
- :'description' => :'String',
146
- :'hypothesis' => :'String',
147
- :'tag' => :'String',
148
- :'owner_email' => :'String',
149
- :'audience' => :'String',
150
- :'bucket_by' => :'String',
151
- :'folder' => :'String',
152
- :'universe' => :'String',
153
- :'targeting_gate' => :'String',
154
- :'allocation_pct' => :'Integer',
155
- :'allocation_percent' => :'Float',
156
- :'salt' => :'String',
157
- :'params' => :'Hash<String, String>',
158
- :'groups' => :'Array<ListExperimentsResponseDataInnerGroupsInner>',
159
- :'significance_threshold' => :'Float',
160
- :'min_runtime_days' => :'Integer',
161
- :'min_sample_size' => :'Integer',
162
- :'sequential_testing' => :'Boolean',
163
- :'goal_metric' => :'ExperimentInlineMetric',
164
- :'guardrail_metrics' => :'Array<ExperimentInlineMetric>'
165
- }
166
- end
167
-
168
- # List of attributes with nullable: true
169
- def self.openapi_nullable
170
- Set.new([
171
- :'description',
172
- :'hypothesis',
173
- :'tag',
174
- :'owner_email',
175
- :'audience',
176
- :'bucket_by',
177
- :'folder',
178
- :'targeting_gate',
179
- ])
180
- end
181
-
182
- # Initializes the object
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- def initialize(attributes = {})
185
- if (!attributes.is_a?(Hash))
186
- fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::CreateExperimentRequest` initialize method"
187
- end
188
-
189
- # check to see if the attribute exists and convert string to symbol for hash key
190
- acceptable_attribute_map = self.class.acceptable_attribute_map
191
- attributes = attributes.each_with_object({}) { |(k, v), h|
192
- if (!acceptable_attribute_map.key?(k.to_sym))
193
- fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::CreateExperimentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
194
- end
195
- h[k.to_sym] = v
196
- }
197
-
198
- if attributes.key?(:'name')
199
- self.name = attributes[:'name']
200
- else
201
- self.name = nil
202
- end
203
-
204
- if attributes.key?(:'description')
205
- self.description = attributes[:'description']
206
- end
207
-
208
- if attributes.key?(:'hypothesis')
209
- self.hypothesis = attributes[:'hypothesis']
210
- end
211
-
212
- if attributes.key?(:'tag')
213
- self.tag = attributes[:'tag']
214
- end
215
-
216
- if attributes.key?(:'owner_email')
217
- self.owner_email = attributes[:'owner_email']
218
- end
219
-
220
- if attributes.key?(:'audience')
221
- self.audience = attributes[:'audience']
222
- end
223
-
224
- if attributes.key?(:'bucket_by')
225
- self.bucket_by = attributes[:'bucket_by']
226
- end
227
-
228
- if attributes.key?(:'folder')
229
- self.folder = attributes[:'folder']
230
- end
231
-
232
- if attributes.key?(:'universe')
233
- self.universe = attributes[:'universe']
234
- else
235
- self.universe = nil
236
- end
237
-
238
- if attributes.key?(:'targeting_gate')
239
- self.targeting_gate = attributes[:'targeting_gate']
240
- end
241
-
242
- if attributes.key?(:'allocation_pct')
243
- self.allocation_pct = attributes[:'allocation_pct']
244
- else
245
- self.allocation_pct = 0
246
- end
247
-
248
- if attributes.key?(:'allocation_percent')
249
- self.allocation_percent = attributes[:'allocation_percent']
250
- end
251
-
252
- if attributes.key?(:'salt')
253
- self.salt = attributes[:'salt']
254
- end
255
-
256
- if attributes.key?(:'params')
257
- if (value = attributes[:'params']).is_a?(Hash)
258
- self.params = value
259
- end
260
- end
261
-
262
- if attributes.key?(:'groups')
263
- if (value = attributes[:'groups']).is_a?(Array)
264
- self.groups = value
265
- end
266
- else
267
- self.groups = nil
268
- end
269
-
270
- if attributes.key?(:'significance_threshold')
271
- self.significance_threshold = attributes[:'significance_threshold']
272
- else
273
- self.significance_threshold = 0.05
274
- end
275
-
276
- if attributes.key?(:'min_runtime_days')
277
- self.min_runtime_days = attributes[:'min_runtime_days']
278
- else
279
- self.min_runtime_days = 0
280
- end
281
-
282
- if attributes.key?(:'min_sample_size')
283
- self.min_sample_size = attributes[:'min_sample_size']
284
- else
285
- self.min_sample_size = 100
286
- end
287
-
288
- if attributes.key?(:'sequential_testing')
289
- self.sequential_testing = attributes[:'sequential_testing']
290
- else
291
- self.sequential_testing = false
292
- end
293
-
294
- if attributes.key?(:'goal_metric')
295
- self.goal_metric = attributes[:'goal_metric']
296
- end
297
-
298
- if attributes.key?(:'guardrail_metrics')
299
- if (value = attributes[:'guardrail_metrics']).is_a?(Array)
300
- self.guardrail_metrics = value
301
- end
302
- end
303
- end
304
-
305
- # Show invalid properties with the reasons. Usually used together with valid?
306
- # @return Array for valid properties with the reasons
307
- def list_invalid_properties
308
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
309
- invalid_properties = Array.new
310
- if @name.nil?
311
- invalid_properties.push('invalid value for "name", name cannot be nil.')
312
- end
313
-
314
- if @name.to_s.length > 128
315
- invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
316
- end
317
-
318
- pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
319
- if @name !~ pattern
320
- invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
321
- end
322
-
323
- if !@description.nil? && @description.to_s.length > 2000
324
- invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
325
- end
326
-
327
- if !@hypothesis.nil? && @hypothesis.to_s.length > 4000
328
- invalid_properties.push('invalid value for "hypothesis", the character length must be smaller than or equal to 4000.')
329
- end
330
-
331
- if !@tag.nil? && @tag.to_s.length > 64
332
- invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 64.')
333
- end
334
-
335
- if !@owner_email.nil? && @owner_email.to_s.length > 254
336
- invalid_properties.push('invalid value for "owner_email", the character length must be smaller than or equal to 254.')
337
- end
338
-
339
- if !@audience.nil? && @audience.to_s.length > 256
340
- invalid_properties.push('invalid value for "audience", the character length must be smaller than or equal to 256.')
341
- end
342
-
343
- if !@bucket_by.nil? && @bucket_by.to_s.length > 128
344
- invalid_properties.push('invalid value for "bucket_by", the character length must be smaller than or equal to 128.')
345
- end
346
-
347
- if !@bucket_by.nil? && @bucket_by.to_s.length < 1
348
- invalid_properties.push('invalid value for "bucket_by", the character length must be greater than or equal to 1.')
349
- end
350
-
351
- pattern = Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
352
- if !@bucket_by.nil? && @bucket_by !~ pattern
353
- invalid_properties.push("invalid value for \"bucket_by\", must conform to the pattern #{pattern}.")
354
- end
355
-
356
- if !@folder.nil? && @folder.to_s.length > 256
357
- invalid_properties.push('invalid value for "folder", the character length must be smaller than or equal to 256.')
358
- end
359
-
360
- pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
361
- if !@folder.nil? && @folder !~ pattern
362
- invalid_properties.push("invalid value for \"folder\", must conform to the pattern #{pattern}.")
363
- end
364
-
365
- if @universe.nil?
366
- invalid_properties.push('invalid value for "universe", universe cannot be nil.')
367
- end
368
-
369
- if @universe.to_s.length < 1
370
- invalid_properties.push('invalid value for "universe", the character length must be greater than or equal to 1.')
371
- end
372
-
373
- if !@allocation_pct.nil? && @allocation_pct > 10000
374
- invalid_properties.push('invalid value for "allocation_pct", must be smaller than or equal to 10000.')
375
- end
376
-
377
- if !@allocation_pct.nil? && @allocation_pct < 0
378
- invalid_properties.push('invalid value for "allocation_pct", must be greater than or equal to 0.')
379
- end
380
-
381
- if !@allocation_percent.nil? && @allocation_percent > 100
382
- invalid_properties.push('invalid value for "allocation_percent", must be smaller than or equal to 100.')
383
- end
384
-
385
- if !@allocation_percent.nil? && @allocation_percent < 0
386
- invalid_properties.push('invalid value for "allocation_percent", must be greater than or equal to 0.')
387
- end
388
-
389
- if !@salt.nil? && @salt.to_s.length > 64
390
- invalid_properties.push('invalid value for "salt", the character length must be smaller than or equal to 64.')
391
- end
392
-
393
- if !@salt.nil? && @salt.to_s.length < 1
394
- invalid_properties.push('invalid value for "salt", the character length must be greater than or equal to 1.')
395
- end
396
-
397
- if @groups.nil?
398
- invalid_properties.push('invalid value for "groups", groups cannot be nil.')
399
- end
400
-
401
- if @groups.length < 2
402
- invalid_properties.push('invalid value for "groups", number of items must be greater than or equal to 2.')
403
- end
404
-
405
- if !@significance_threshold.nil? && @significance_threshold > 0.5
406
- invalid_properties.push('invalid value for "significance_threshold", must be smaller than or equal to 0.5.')
407
- end
408
-
409
- if !@significance_threshold.nil? && @significance_threshold < 0.00010
410
- invalid_properties.push('invalid value for "significance_threshold", must be greater than or equal to 0.00010.')
411
- end
412
-
413
- if !@min_runtime_days.nil? && @min_runtime_days > 365
414
- invalid_properties.push('invalid value for "min_runtime_days", must be smaller than or equal to 365.')
415
- end
416
-
417
- if !@min_runtime_days.nil? && @min_runtime_days < 0
418
- invalid_properties.push('invalid value for "min_runtime_days", must be greater than or equal to 0.')
419
- end
420
-
421
- if !@min_sample_size.nil? && @min_sample_size > 9007199254740991
422
- invalid_properties.push('invalid value for "min_sample_size", must be smaller than or equal to 9007199254740991.')
423
- end
424
-
425
- if !@min_sample_size.nil? && @min_sample_size < 1
426
- invalid_properties.push('invalid value for "min_sample_size", must be greater than or equal to 1.')
427
- end
428
-
429
- if !@guardrail_metrics.nil? && @guardrail_metrics.length > 10
430
- invalid_properties.push('invalid value for "guardrail_metrics", number of items must be less than or equal to 10.')
431
- end
432
-
433
- invalid_properties
434
- end
435
-
436
- # Check to see if the all the properties in the model are valid
437
- # @return true if the model is valid
438
- def valid?
439
- warn '[DEPRECATED] the `valid?` method is obsolete'
440
- return false if @name.nil?
441
- return false if @name.to_s.length > 128
442
- return false if @name !~ Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
443
- return false if !@description.nil? && @description.to_s.length > 2000
444
- return false if !@hypothesis.nil? && @hypothesis.to_s.length > 4000
445
- return false if !@tag.nil? && @tag.to_s.length > 64
446
- return false if !@owner_email.nil? && @owner_email.to_s.length > 254
447
- return false if !@audience.nil? && @audience.to_s.length > 256
448
- return false if !@bucket_by.nil? && @bucket_by.to_s.length > 128
449
- return false if !@bucket_by.nil? && @bucket_by.to_s.length < 1
450
- return false if !@bucket_by.nil? && @bucket_by !~ Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
451
- return false if !@folder.nil? && @folder.to_s.length > 256
452
- return false if !@folder.nil? && @folder !~ Regexp.new(/^[a-zA-Z0-9_-]+$/)
453
- return false if @universe.nil?
454
- return false if @universe.to_s.length < 1
455
- return false if !@allocation_pct.nil? && @allocation_pct > 10000
456
- return false if !@allocation_pct.nil? && @allocation_pct < 0
457
- return false if !@allocation_percent.nil? && @allocation_percent > 100
458
- return false if !@allocation_percent.nil? && @allocation_percent < 0
459
- return false if !@salt.nil? && @salt.to_s.length > 64
460
- return false if !@salt.nil? && @salt.to_s.length < 1
461
- return false if @groups.nil?
462
- return false if @groups.length < 2
463
- return false if !@significance_threshold.nil? && @significance_threshold > 0.5
464
- return false if !@significance_threshold.nil? && @significance_threshold < 0.00010
465
- return false if !@min_runtime_days.nil? && @min_runtime_days > 365
466
- return false if !@min_runtime_days.nil? && @min_runtime_days < 0
467
- return false if !@min_sample_size.nil? && @min_sample_size > 9007199254740991
468
- return false if !@min_sample_size.nil? && @min_sample_size < 1
469
- return false if !@guardrail_metrics.nil? && @guardrail_metrics.length > 10
470
- true
471
- end
472
-
473
- # Custom attribute writer method with validation
474
- # @param [Object] name Value to be assigned
475
- def name=(name)
476
- if name.nil?
477
- fail ArgumentError, 'name cannot be nil'
478
- end
479
-
480
- if name.to_s.length > 128
481
- fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
482
- end
483
-
484
- pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
485
- if name !~ pattern
486
- fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
487
- end
488
-
489
- @name = name
490
- end
491
-
492
- # Custom attribute writer method with validation
493
- # @param [Object] description Value to be assigned
494
- def description=(description)
495
- if !description.nil? && description.to_s.length > 2000
496
- fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2000.'
497
- end
498
-
499
- @description = description
500
- end
501
-
502
- # Custom attribute writer method with validation
503
- # @param [Object] hypothesis Value to be assigned
504
- def hypothesis=(hypothesis)
505
- if !hypothesis.nil? && hypothesis.to_s.length > 4000
506
- fail ArgumentError, 'invalid value for "hypothesis", the character length must be smaller than or equal to 4000.'
507
- end
508
-
509
- @hypothesis = hypothesis
510
- end
511
-
512
- # Custom attribute writer method with validation
513
- # @param [Object] tag Value to be assigned
514
- def tag=(tag)
515
- if !tag.nil? && tag.to_s.length > 64
516
- fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 64.'
517
- end
518
-
519
- @tag = tag
520
- end
521
-
522
- # Custom attribute writer method with validation
523
- # @param [Object] owner_email Value to be assigned
524
- def owner_email=(owner_email)
525
- if !owner_email.nil? && owner_email.to_s.length > 254
526
- fail ArgumentError, 'invalid value for "owner_email", the character length must be smaller than or equal to 254.'
527
- end
528
-
529
- @owner_email = owner_email
530
- end
531
-
532
- # Custom attribute writer method with validation
533
- # @param [Object] audience Value to be assigned
534
- def audience=(audience)
535
- if !audience.nil? && audience.to_s.length > 256
536
- fail ArgumentError, 'invalid value for "audience", the character length must be smaller than or equal to 256.'
537
- end
538
-
539
- @audience = audience
540
- end
541
-
542
- # Custom attribute writer method with validation
543
- # @param [Object] bucket_by Value to be assigned
544
- def bucket_by=(bucket_by)
545
- if !bucket_by.nil? && bucket_by.to_s.length > 128
546
- fail ArgumentError, 'invalid value for "bucket_by", the character length must be smaller than or equal to 128.'
547
- end
548
-
549
- if !bucket_by.nil? && bucket_by.to_s.length < 1
550
- fail ArgumentError, 'invalid value for "bucket_by", the character length must be greater than or equal to 1.'
551
- end
552
-
553
- pattern = Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
554
- if !bucket_by.nil? && bucket_by !~ pattern
555
- fail ArgumentError, "invalid value for \"bucket_by\", must conform to the pattern #{pattern}."
556
- end
557
-
558
- @bucket_by = bucket_by
559
- end
560
-
561
- # Custom attribute writer method with validation
562
- # @param [Object] folder Value to be assigned
563
- def folder=(folder)
564
- if !folder.nil? && folder.to_s.length > 256
565
- fail ArgumentError, 'invalid value for "folder", the character length must be smaller than or equal to 256.'
566
- end
567
-
568
- pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
569
- if !folder.nil? && folder !~ pattern
570
- fail ArgumentError, "invalid value for \"folder\", must conform to the pattern #{pattern}."
571
- end
572
-
573
- @folder = folder
574
- end
575
-
576
- # Custom attribute writer method with validation
577
- # @param [Object] universe Value to be assigned
578
- def universe=(universe)
579
- if universe.nil?
580
- fail ArgumentError, 'universe cannot be nil'
581
- end
582
-
583
- if universe.to_s.length < 1
584
- fail ArgumentError, 'invalid value for "universe", the character length must be greater than or equal to 1.'
585
- end
586
-
587
- @universe = universe
588
- end
589
-
590
- # Custom attribute writer method with validation
591
- # @param [Object] allocation_pct Value to be assigned
592
- def allocation_pct=(allocation_pct)
593
- if allocation_pct.nil?
594
- fail ArgumentError, 'allocation_pct cannot be nil'
595
- end
596
-
597
- if allocation_pct > 10000
598
- fail ArgumentError, 'invalid value for "allocation_pct", must be smaller than or equal to 10000.'
599
- end
600
-
601
- if allocation_pct < 0
602
- fail ArgumentError, 'invalid value for "allocation_pct", must be greater than or equal to 0.'
603
- end
604
-
605
- @allocation_pct = allocation_pct
606
- end
607
-
608
- # Custom attribute writer method with validation
609
- # @param [Object] allocation_percent Value to be assigned
610
- def allocation_percent=(allocation_percent)
611
- if allocation_percent.nil?
612
- fail ArgumentError, 'allocation_percent cannot be nil'
613
- end
614
-
615
- if allocation_percent > 100
616
- fail ArgumentError, 'invalid value for "allocation_percent", must be smaller than or equal to 100.'
617
- end
618
-
619
- if allocation_percent < 0
620
- fail ArgumentError, 'invalid value for "allocation_percent", must be greater than or equal to 0.'
621
- end
622
-
623
- @allocation_percent = allocation_percent
624
- end
625
-
626
- # Custom attribute writer method with validation
627
- # @param [Object] salt Value to be assigned
628
- def salt=(salt)
629
- if salt.nil?
630
- fail ArgumentError, 'salt cannot be nil'
631
- end
632
-
633
- if salt.to_s.length > 64
634
- fail ArgumentError, 'invalid value for "salt", the character length must be smaller than or equal to 64.'
635
- end
636
-
637
- if salt.to_s.length < 1
638
- fail ArgumentError, 'invalid value for "salt", the character length must be greater than or equal to 1.'
639
- end
640
-
641
- @salt = salt
642
- end
643
-
644
- # Custom attribute writer method with validation
645
- # @param [Object] groups Value to be assigned
646
- def groups=(groups)
647
- if groups.nil?
648
- fail ArgumentError, 'groups cannot be nil'
649
- end
650
-
651
- if groups.length < 2
652
- fail ArgumentError, 'invalid value for "groups", number of items must be greater than or equal to 2.'
653
- end
654
-
655
- @groups = groups
656
- end
657
-
658
- # Custom attribute writer method with validation
659
- # @param [Object] significance_threshold Value to be assigned
660
- def significance_threshold=(significance_threshold)
661
- if significance_threshold.nil?
662
- fail ArgumentError, 'significance_threshold cannot be nil'
663
- end
664
-
665
- if significance_threshold > 0.5
666
- fail ArgumentError, 'invalid value for "significance_threshold", must be smaller than or equal to 0.5.'
667
- end
668
-
669
- if significance_threshold < 0.00010
670
- fail ArgumentError, 'invalid value for "significance_threshold", must be greater than or equal to 0.00010.'
671
- end
672
-
673
- @significance_threshold = significance_threshold
674
- end
675
-
676
- # Custom attribute writer method with validation
677
- # @param [Object] min_runtime_days Value to be assigned
678
- def min_runtime_days=(min_runtime_days)
679
- if min_runtime_days.nil?
680
- fail ArgumentError, 'min_runtime_days cannot be nil'
681
- end
682
-
683
- if min_runtime_days > 365
684
- fail ArgumentError, 'invalid value for "min_runtime_days", must be smaller than or equal to 365.'
685
- end
686
-
687
- if min_runtime_days < 0
688
- fail ArgumentError, 'invalid value for "min_runtime_days", must be greater than or equal to 0.'
689
- end
690
-
691
- @min_runtime_days = min_runtime_days
692
- end
693
-
694
- # Custom attribute writer method with validation
695
- # @param [Object] min_sample_size Value to be assigned
696
- def min_sample_size=(min_sample_size)
697
- if min_sample_size.nil?
698
- fail ArgumentError, 'min_sample_size cannot be nil'
699
- end
700
-
701
- if min_sample_size > 9007199254740991
702
- fail ArgumentError, 'invalid value for "min_sample_size", must be smaller than or equal to 9007199254740991.'
703
- end
704
-
705
- if min_sample_size < 1
706
- fail ArgumentError, 'invalid value for "min_sample_size", must be greater than or equal to 1.'
707
- end
708
-
709
- @min_sample_size = min_sample_size
710
- end
711
-
712
- # Custom attribute writer method with validation
713
- # @param [Object] guardrail_metrics Value to be assigned
714
- def guardrail_metrics=(guardrail_metrics)
715
- if guardrail_metrics.nil?
716
- fail ArgumentError, 'guardrail_metrics cannot be nil'
717
- end
718
-
719
- if guardrail_metrics.length > 10
720
- fail ArgumentError, 'invalid value for "guardrail_metrics", number of items must be less than or equal to 10.'
721
- end
722
-
723
- @guardrail_metrics = guardrail_metrics
724
- end
725
-
726
- # Checks equality by comparing each attribute.
727
- # @param [Object] Object to be compared
728
- def ==(o)
729
- return true if self.equal?(o)
730
- self.class == o.class &&
731
- name == o.name &&
732
- description == o.description &&
733
- hypothesis == o.hypothesis &&
734
- tag == o.tag &&
735
- owner_email == o.owner_email &&
736
- audience == o.audience &&
737
- bucket_by == o.bucket_by &&
738
- folder == o.folder &&
739
- universe == o.universe &&
740
- targeting_gate == o.targeting_gate &&
741
- allocation_pct == o.allocation_pct &&
742
- allocation_percent == o.allocation_percent &&
743
- salt == o.salt &&
744
- params == o.params &&
745
- groups == o.groups &&
746
- significance_threshold == o.significance_threshold &&
747
- min_runtime_days == o.min_runtime_days &&
748
- min_sample_size == o.min_sample_size &&
749
- sequential_testing == o.sequential_testing &&
750
- goal_metric == o.goal_metric &&
751
- guardrail_metrics == o.guardrail_metrics
752
- end
753
-
754
- # @see the `==` method
755
- # @param [Object] Object to be compared
756
- def eql?(o)
757
- self == o
758
- end
759
-
760
- # Calculates hash code according to all attributes.
761
- # @return [Integer] Hash code
762
- def hash
763
- [name, description, hypothesis, tag, owner_email, audience, bucket_by, folder, universe, targeting_gate, allocation_pct, allocation_percent, salt, params, groups, significance_threshold, min_runtime_days, min_sample_size, sequential_testing, goal_metric, guardrail_metrics].hash
764
- end
765
-
766
- # Builds the object from hash
767
- # @param [Hash] attributes Model attributes in the form of hash
768
- # @return [Object] Returns the model itself
769
- def self.build_from_hash(attributes)
770
- return nil unless attributes.is_a?(Hash)
771
- attributes = attributes.transform_keys(&:to_sym)
772
- transformed_hash = {}
773
- openapi_types.each_pair do |key, type|
774
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
775
- transformed_hash["#{key}"] = nil
776
- elsif type =~ /\AArray<(.*)>/i
777
- # check to ensure the input is an array given that the attribute
778
- # is documented as an array but the input is not
779
- if attributes[attribute_map[key]].is_a?(Array)
780
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
781
- end
782
- elsif !attributes[attribute_map[key]].nil?
783
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
784
- end
785
- end
786
- new(transformed_hash)
787
- end
788
-
789
- # Returns the object in the form of hash
790
- # @return [Hash] Returns the object in the form of hash
791
- def to_hash
792
- hash = {}
793
- self.class.attribute_map.each_pair do |attr, param|
794
- value = self.send(attr)
795
- if value.nil?
796
- is_nullable = self.class.openapi_nullable.include?(attr)
797
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
798
- end
799
-
800
- hash[param] = _to_hash(value)
801
- end
802
- hash
803
- end
804
-
805
- end
806
-
807
- end