shipeasy-sdk 2.1.0 → 2.3.1

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 (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/docs/skill/SKILL.md +6 -2
  4. data/lib/generators/shipeasy/install/USAGE +24 -0
  5. data/lib/generators/shipeasy/install/install_generator.rb +86 -0
  6. data/lib/generators/shipeasy/install/templates/initializer.rb.tt +41 -0
  7. data/lib/shipeasy/admin.rb +91 -0
  8. data/lib/shipeasy/sdk/version.rb +1 -1
  9. data/lib/shipeasy_admin/api/alerts_api.rb +352 -0
  10. data/lib/shipeasy_admin/api/api_keys_api.rb +229 -0
  11. data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
  12. data/lib/shipeasy_admin/api/configs_api.rb +757 -0
  13. data/lib/shipeasy_admin/api/connectors_api.rb +497 -0
  14. data/lib/shipeasy_admin/api/drafts_api.rb +82 -0
  15. data/lib/shipeasy_admin/api/errors_api.rb +389 -0
  16. data/lib/shipeasy_admin/api/events_api.rb +438 -0
  17. data/lib/shipeasy_admin/api/experiments_api.rb +727 -0
  18. data/lib/shipeasy_admin/api/flags_api.rb +438 -0
  19. data/lib/shipeasy_admin/api/keys_api.rb +317 -0
  20. data/lib/shipeasy_admin/api/killswitch_api.rb +603 -0
  21. data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
  22. data/lib/shipeasy_admin/api/ops_api.rb +465 -0
  23. data/lib/shipeasy_admin/api/profiles_api.rb +226 -0
  24. data/lib/shipeasy_admin/api/projects_api.rb +216 -0
  25. data/lib/shipeasy_admin/api/universes_api.rb +306 -0
  26. data/lib/shipeasy_admin/api_client.rb +441 -0
  27. data/lib/shipeasy_admin/api_error.rb +58 -0
  28. data/lib/shipeasy_admin/api_model_base.rb +88 -0
  29. data/lib/shipeasy_admin/configuration.rb +397 -0
  30. data/lib/shipeasy_admin/models/approve_event_request.rb +198 -0
  31. data/lib/shipeasy_admin/models/approve_event_response.rb +166 -0
  32. data/lib/shipeasy_admin/models/claude_trigger_config.rb +204 -0
  33. data/lib/shipeasy_admin/models/connector_event.rb +40 -0
  34. data/lib/shipeasy_admin/models/connector_provider.rb +45 -0
  35. data/lib/shipeasy_admin/models/connector_record.rb +468 -0
  36. data/lib/shipeasy_admin/models/copilot_trigger_config.rb +276 -0
  37. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +383 -0
  38. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
  39. data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +309 -0
  40. data/lib/shipeasy_admin/models/create_config_request.rb +291 -0
  41. data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
  42. data/lib/shipeasy_admin/models/create_connector_request.rb +64 -0
  43. data/lib/shipeasy_admin/models/create_connector_response.rb +165 -0
  44. data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +316 -0
  45. data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +352 -0
  46. data/lib/shipeasy_admin/models/create_event_request.rb +236 -0
  47. data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
  48. data/lib/shipeasy_admin/models/create_experiment_request.rb +807 -0
  49. data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
  50. data/lib/shipeasy_admin/models/create_gate_request.rb +492 -0
  51. data/lib/shipeasy_admin/models/create_gate_response.rb +212 -0
  52. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +188 -0
  53. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +193 -0
  54. data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +352 -0
  55. data/lib/shipeasy_admin/models/create_key_request.rb +297 -0
  56. data/lib/shipeasy_admin/models/create_key_response.rb +286 -0
  57. data/lib/shipeasy_admin/models/create_killswitch_request.rb +274 -0
  58. data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
  59. data/lib/shipeasy_admin/models/create_metric_request.rb +403 -0
  60. data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
  61. data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +273 -0
  62. data/lib/shipeasy_admin/models/create_ops_item_request.rb +287 -0
  63. data/lib/shipeasy_admin/models/create_ops_item_response.rb +177 -0
  64. data/lib/shipeasy_admin/models/create_universe_request.rb +272 -0
  65. data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
  66. data/lib/shipeasy_admin/models/cursor_trigger_config.rb +231 -0
  67. data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +188 -0
  68. data/lib/shipeasy_admin/models/delete_config_response.rb +188 -0
  69. data/lib/shipeasy_admin/models/delete_connector_response.rb +188 -0
  70. data/lib/shipeasy_admin/models/delete_event_response.rb +189 -0
  71. data/lib/shipeasy_admin/models/delete_experiment_response.rb +188 -0
  72. data/lib/shipeasy_admin/models/delete_gate_response.rb +188 -0
  73. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +188 -0
  74. data/lib/shipeasy_admin/models/delete_metric_response.rb +189 -0
  75. data/lib/shipeasy_admin/models/delete_universe_response.rb +188 -0
  76. data/lib/shipeasy_admin/models/disable_gate_response.rb +190 -0
  77. data/lib/shipeasy_admin/models/discard_config_draft_request.rb +187 -0
  78. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +188 -0
  79. data/lib/shipeasy_admin/models/enable_gate_response.rb +190 -0
  80. data/lib/shipeasy_admin/models/env.rb +41 -0
  81. data/lib/shipeasy_admin/models/error.rb +207 -0
  82. data/lib/shipeasy_admin/models/error_code.rb +52 -0
  83. data/lib/shipeasy_admin/models/error_record.rb +597 -0
  84. data/lib/shipeasy_admin/models/error_series_request.rb +251 -0
  85. data/lib/shipeasy_admin/models/error_series_response.rb +195 -0
  86. data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +192 -0
  87. data/lib/shipeasy_admin/models/experiment_inline_metric.rb +337 -0
  88. data/lib/shipeasy_admin/models/file_error_ticket_response.rb +193 -0
  89. data/lib/shipeasy_admin/models/fire_connector_request.rb +149 -0
  90. data/lib/shipeasy_admin/models/fire_connector_response.rb +176 -0
  91. data/lib/shipeasy_admin/models/get_config_response.rb +351 -0
  92. data/lib/shipeasy_admin/models/get_current_project_response.rb +606 -0
  93. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +104 -0
  94. data/lib/shipeasy_admin/models/get_event_response.rb +344 -0
  95. data/lib/shipeasy_admin/models/get_experiment_response.rb +688 -0
  96. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +243 -0
  97. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +248 -0
  98. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +252 -0
  99. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +192 -0
  100. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +261 -0
  101. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +278 -0
  102. data/lib/shipeasy_admin/models/get_killswitch_response.rb +270 -0
  103. data/lib/shipeasy_admin/models/get_metric_response.rb +378 -0
  104. data/lib/shipeasy_admin/models/get_ops_item_response.rb +349 -0
  105. data/lib/shipeasy_admin/models/jules_trigger_config.rb +240 -0
  106. data/lib/shipeasy_admin/models/key_record.rb +353 -0
  107. data/lib/shipeasy_admin/models/killswitch_value.rb +178 -0
  108. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +186 -0
  109. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +166 -0
  110. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +478 -0
  111. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +176 -0
  112. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +280 -0
  113. data/lib/shipeasy_admin/models/list_configs_response.rb +178 -0
  114. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +351 -0
  115. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +237 -0
  116. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +237 -0
  117. data/lib/shipeasy_admin/models/list_events_response_inner.rb +344 -0
  118. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +259 -0
  119. data/lib/shipeasy_admin/models/list_experiments_response.rb +178 -0
  120. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +688 -0
  121. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +241 -0
  122. data/lib/shipeasy_admin/models/list_gates_response.rb +178 -0
  123. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +395 -0
  124. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +104 -0
  125. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +238 -0
  126. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +105 -0
  127. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +358 -0
  128. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +331 -0
  129. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +319 -0
  130. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +272 -0
  131. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +195 -0
  132. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +284 -0
  133. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +224 -0
  134. data/lib/shipeasy_admin/models/list_keys_response.rb +180 -0
  135. data/lib/shipeasy_admin/models/list_killswitches_response.rb +178 -0
  136. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +270 -0
  137. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +248 -0
  138. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +378 -0
  139. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +288 -0
  140. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +113 -0
  141. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +188 -0
  142. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +188 -0
  143. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +188 -0
  144. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +188 -0
  145. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +188 -0
  146. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +188 -0
  147. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +188 -0
  148. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +217 -0
  149. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +233 -0
  150. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +240 -0
  151. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +266 -0
  152. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +264 -0
  153. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +228 -0
  154. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +349 -0
  155. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +195 -0
  156. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +203 -0
  157. data/lib/shipeasy_admin/models/list_universes_response.rb +178 -0
  158. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +305 -0
  159. data/lib/shipeasy_admin/models/notification_target.rb +159 -0
  160. data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +208 -0
  161. data/lib/shipeasy_admin/models/notify_ops_request.rb +261 -0
  162. data/lib/shipeasy_admin/models/notify_ops_response.rb +193 -0
  163. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +187 -0
  164. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +257 -0
  165. data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +149 -0
  166. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +404 -0
  167. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +205 -0
  168. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +192 -0
  169. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +261 -0
  170. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +214 -0
  171. data/lib/shipeasy_admin/models/revoke_key_response.rb +216 -0
  172. data/lib/shipeasy_admin/models/save_config_draft_request.rb +199 -0
  173. data/lib/shipeasy_admin/models/save_config_draft_response.rb +283 -0
  174. data/lib/shipeasy_admin/models/search_hit.rb +284 -0
  175. data/lib/shipeasy_admin/models/search_response.rb +167 -0
  176. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +168 -0
  177. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +216 -0
  178. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +179 -0
  179. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +201 -0
  180. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +190 -0
  181. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +214 -0
  182. data/lib/shipeasy_admin/models/set_i18n_label_request.rb +213 -0
  183. data/lib/shipeasy_admin/models/set_i18n_label_response.rb +472 -0
  184. data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +261 -0
  185. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +285 -0
  186. data/lib/shipeasy_admin/models/set_killswitch_value_request.rb +214 -0
  187. data/lib/shipeasy_admin/models/set_killswitch_value_response.rb +283 -0
  188. data/lib/shipeasy_admin/models/test_connector_response.rb +189 -0
  189. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +234 -0
  190. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +286 -0
  191. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +304 -0
  192. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +165 -0
  193. data/lib/shipeasy_admin/models/update_config_request.rb +198 -0
  194. data/lib/shipeasy_admin/models/update_config_response.rb +165 -0
  195. data/lib/shipeasy_admin/models/update_config_schema_request.rb +168 -0
  196. data/lib/shipeasy_admin/models/update_config_schema_response.rb +165 -0
  197. data/lib/shipeasy_admin/models/update_connector_request.rb +211 -0
  198. data/lib/shipeasy_admin/models/update_connector_response.rb +166 -0
  199. data/lib/shipeasy_admin/models/update_error_status_request.rb +190 -0
  200. data/lib/shipeasy_admin/models/update_event_request.rb +198 -0
  201. data/lib/shipeasy_admin/models/update_event_response.rb +166 -0
  202. data/lib/shipeasy_admin/models/update_experiment_request.rb +747 -0
  203. data/lib/shipeasy_admin/models/update_experiment_response.rb +165 -0
  204. data/lib/shipeasy_admin/models/update_gate_request.rb +403 -0
  205. data/lib/shipeasy_admin/models/update_gate_response.rb +166 -0
  206. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +176 -0
  207. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +166 -0
  208. data/lib/shipeasy_admin/models/update_killswitch_request.rb +224 -0
  209. data/lib/shipeasy_admin/models/update_killswitch_response.rb +165 -0
  210. data/lib/shipeasy_admin/models/update_ops_item_request.rb +205 -0
  211. data/lib/shipeasy_admin/models/update_ops_item_response.rb +166 -0
  212. data/lib/shipeasy_admin/models/update_universe_request.rb +213 -0
  213. data/lib/shipeasy_admin/models/update_universe_response.rb +165 -0
  214. data/lib/shipeasy_admin/models/upsert_project_request.rb +222 -0
  215. data/lib/shipeasy_admin/models/upsert_project_response.rb +260 -0
  216. data/lib/shipeasy_admin/version.rb +15 -0
  217. data/lib/shipeasy_admin.rb +243 -0
  218. metadata +277 -2
@@ -0,0 +1,747 @@
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/experiments/{id}`. Partial — only supplied fields change. `allocation_pct`, `groups`, `salt`, `universe`, `params` are immutable while the experiment is running (stop first).
18
+ class UpdateExperimentRequest < 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
+ attr_accessor :description
23
+
24
+ attr_accessor :hypothesis
25
+
26
+ attr_accessor :tag
27
+
28
+ attr_accessor :owner_email
29
+
30
+ attr_accessor :audience
31
+
32
+ # 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.
33
+ attr_accessor :bucket_by
34
+
35
+ # Optional folder name grouping items in the dashboard. Alphanumeric, `_` or `-` (no `/`). Part of the SDK lookup key (`<folder>/<name>`).
36
+ attr_accessor :folder
37
+
38
+ attr_accessor :targeting_gate
39
+
40
+ # Basis-points allocation (0–10000). Use `allocation_percent` (0–100) for percent. Immutable while the experiment is running.
41
+ attr_accessor :allocation_pct
42
+
43
+ # Allocation as a **percentage** (0–100). Friendlier alias for `allocation_pct`; converted to basis points server-side. Wins over `allocation_pct` if both are supplied. Immutable while running.
44
+ attr_accessor :allocation_percent
45
+
46
+ # Hash salt. Immutable while running.
47
+ attr_accessor :salt
48
+
49
+ # New universe name. Immutable while running. Returns `422` if the universe doesn't exist.
50
+ attr_accessor :universe
51
+
52
+ # Map of param-name → scalar type. Defines the shape of `groups[].params`. Example: `{ headline: 'string', show_cta: 'bool' }`.
53
+ attr_accessor :params
54
+
55
+ # Replacement groups. Weights must sum to 10000. Immutable while running.
56
+ attr_accessor :groups
57
+
58
+ attr_accessor :significance_threshold
59
+
60
+ attr_accessor :min_runtime_days
61
+
62
+ attr_accessor :min_sample_size
63
+
64
+ attr_accessor :sequential_testing
65
+
66
+ # Replaces the goal metric — DSL `query` or `event` (+`aggregation`/`value`) the server compiles (event auto-upserted).
67
+ attr_accessor :goal_metric
68
+
69
+ # Replaces the guardrail set wholesale (event auto-upserted per entry).
70
+ attr_accessor :guardrail_metrics
71
+
72
+ class EnumAttributeValidator
73
+ attr_reader :datatype
74
+ attr_reader :allowable_values
75
+
76
+ def initialize(datatype, allowable_values)
77
+ @allowable_values = allowable_values.map do |value|
78
+ case datatype.to_s
79
+ when /Integer/i
80
+ value.to_i
81
+ when /Float/i
82
+ value.to_f
83
+ else
84
+ value
85
+ end
86
+ end
87
+ end
88
+
89
+ def valid?(value)
90
+ !value || allowable_values.include?(value)
91
+ end
92
+ end
93
+
94
+ # Attribute mapping from ruby-style variable name to JSON key.
95
+ def self.attribute_map
96
+ {
97
+ :'name' => :'name',
98
+ :'description' => :'description',
99
+ :'hypothesis' => :'hypothesis',
100
+ :'tag' => :'tag',
101
+ :'owner_email' => :'owner_email',
102
+ :'audience' => :'audience',
103
+ :'bucket_by' => :'bucket_by',
104
+ :'folder' => :'folder',
105
+ :'targeting_gate' => :'targeting_gate',
106
+ :'allocation_pct' => :'allocation_pct',
107
+ :'allocation_percent' => :'allocation_percent',
108
+ :'salt' => :'salt',
109
+ :'universe' => :'universe',
110
+ :'params' => :'params',
111
+ :'groups' => :'groups',
112
+ :'significance_threshold' => :'significance_threshold',
113
+ :'min_runtime_days' => :'min_runtime_days',
114
+ :'min_sample_size' => :'min_sample_size',
115
+ :'sequential_testing' => :'sequential_testing',
116
+ :'goal_metric' => :'goal_metric',
117
+ :'guardrail_metrics' => :'guardrail_metrics'
118
+ }
119
+ end
120
+
121
+ # Returns attribute mapping this model knows about
122
+ def self.acceptable_attribute_map
123
+ attribute_map
124
+ end
125
+
126
+ # Returns all the JSON keys this model knows about
127
+ def self.acceptable_attributes
128
+ acceptable_attribute_map.values
129
+ end
130
+
131
+ # Attribute type mapping.
132
+ def self.openapi_types
133
+ {
134
+ :'name' => :'String',
135
+ :'description' => :'String',
136
+ :'hypothesis' => :'String',
137
+ :'tag' => :'String',
138
+ :'owner_email' => :'String',
139
+ :'audience' => :'String',
140
+ :'bucket_by' => :'String',
141
+ :'folder' => :'String',
142
+ :'targeting_gate' => :'String',
143
+ :'allocation_pct' => :'Integer',
144
+ :'allocation_percent' => :'Float',
145
+ :'salt' => :'String',
146
+ :'universe' => :'String',
147
+ :'params' => :'Hash<String, String>',
148
+ :'groups' => :'Array<ListExperimentsResponseDataInnerGroupsInner>',
149
+ :'significance_threshold' => :'Float',
150
+ :'min_runtime_days' => :'Integer',
151
+ :'min_sample_size' => :'Integer',
152
+ :'sequential_testing' => :'Boolean',
153
+ :'goal_metric' => :'ExperimentInlineMetric',
154
+ :'guardrail_metrics' => :'Array<ExperimentInlineMetric>'
155
+ }
156
+ end
157
+
158
+ # List of attributes with nullable: true
159
+ def self.openapi_nullable
160
+ Set.new([
161
+ :'description',
162
+ :'hypothesis',
163
+ :'tag',
164
+ :'owner_email',
165
+ :'audience',
166
+ :'bucket_by',
167
+ :'folder',
168
+ :'targeting_gate',
169
+ ])
170
+ end
171
+
172
+ # Initializes the object
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ def initialize(attributes = {})
175
+ if (!attributes.is_a?(Hash))
176
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::UpdateExperimentRequest` initialize method"
177
+ end
178
+
179
+ # check to see if the attribute exists and convert string to symbol for hash key
180
+ acceptable_attribute_map = self.class.acceptable_attribute_map
181
+ attributes = attributes.each_with_object({}) { |(k, v), h|
182
+ if (!acceptable_attribute_map.key?(k.to_sym))
183
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::UpdateExperimentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
184
+ end
185
+ h[k.to_sym] = v
186
+ }
187
+
188
+ if attributes.key?(:'name')
189
+ self.name = attributes[:'name']
190
+ end
191
+
192
+ if attributes.key?(:'description')
193
+ self.description = attributes[:'description']
194
+ end
195
+
196
+ if attributes.key?(:'hypothesis')
197
+ self.hypothesis = attributes[:'hypothesis']
198
+ end
199
+
200
+ if attributes.key?(:'tag')
201
+ self.tag = attributes[:'tag']
202
+ end
203
+
204
+ if attributes.key?(:'owner_email')
205
+ self.owner_email = attributes[:'owner_email']
206
+ end
207
+
208
+ if attributes.key?(:'audience')
209
+ self.audience = attributes[:'audience']
210
+ end
211
+
212
+ if attributes.key?(:'bucket_by')
213
+ self.bucket_by = attributes[:'bucket_by']
214
+ end
215
+
216
+ if attributes.key?(:'folder')
217
+ self.folder = attributes[:'folder']
218
+ end
219
+
220
+ if attributes.key?(:'targeting_gate')
221
+ self.targeting_gate = attributes[:'targeting_gate']
222
+ end
223
+
224
+ if attributes.key?(:'allocation_pct')
225
+ self.allocation_pct = attributes[:'allocation_pct']
226
+ end
227
+
228
+ if attributes.key?(:'allocation_percent')
229
+ self.allocation_percent = attributes[:'allocation_percent']
230
+ end
231
+
232
+ if attributes.key?(:'salt')
233
+ self.salt = attributes[:'salt']
234
+ end
235
+
236
+ if attributes.key?(:'universe')
237
+ self.universe = attributes[:'universe']
238
+ end
239
+
240
+ if attributes.key?(:'params')
241
+ if (value = attributes[:'params']).is_a?(Hash)
242
+ self.params = value
243
+ end
244
+ end
245
+
246
+ if attributes.key?(:'groups')
247
+ if (value = attributes[:'groups']).is_a?(Array)
248
+ self.groups = value
249
+ end
250
+ end
251
+
252
+ if attributes.key?(:'significance_threshold')
253
+ self.significance_threshold = attributes[:'significance_threshold']
254
+ end
255
+
256
+ if attributes.key?(:'min_runtime_days')
257
+ self.min_runtime_days = attributes[:'min_runtime_days']
258
+ end
259
+
260
+ if attributes.key?(:'min_sample_size')
261
+ self.min_sample_size = attributes[:'min_sample_size']
262
+ end
263
+
264
+ if attributes.key?(:'sequential_testing')
265
+ self.sequential_testing = attributes[:'sequential_testing']
266
+ end
267
+
268
+ if attributes.key?(:'goal_metric')
269
+ self.goal_metric = attributes[:'goal_metric']
270
+ end
271
+
272
+ if attributes.key?(:'guardrail_metrics')
273
+ if (value = attributes[:'guardrail_metrics']).is_a?(Array)
274
+ self.guardrail_metrics = value
275
+ end
276
+ end
277
+ end
278
+
279
+ # Show invalid properties with the reasons. Usually used together with valid?
280
+ # @return Array for valid properties with the reasons
281
+ def list_invalid_properties
282
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
283
+ invalid_properties = Array.new
284
+ if !@name.nil? && @name.to_s.length > 128
285
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
286
+ end
287
+
288
+ pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
289
+ if !@name.nil? && @name !~ pattern
290
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
291
+ end
292
+
293
+ if !@description.nil? && @description.to_s.length > 2000
294
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
295
+ end
296
+
297
+ if !@hypothesis.nil? && @hypothesis.to_s.length > 4000
298
+ invalid_properties.push('invalid value for "hypothesis", the character length must be smaller than or equal to 4000.')
299
+ end
300
+
301
+ if !@tag.nil? && @tag.to_s.length > 64
302
+ invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 64.')
303
+ end
304
+
305
+ if !@owner_email.nil? && @owner_email.to_s.length > 254
306
+ invalid_properties.push('invalid value for "owner_email", the character length must be smaller than or equal to 254.')
307
+ end
308
+
309
+ if !@audience.nil? && @audience.to_s.length > 256
310
+ invalid_properties.push('invalid value for "audience", the character length must be smaller than or equal to 256.')
311
+ end
312
+
313
+ if !@bucket_by.nil? && @bucket_by.to_s.length > 128
314
+ invalid_properties.push('invalid value for "bucket_by", the character length must be smaller than or equal to 128.')
315
+ end
316
+
317
+ if !@bucket_by.nil? && @bucket_by.to_s.length < 1
318
+ invalid_properties.push('invalid value for "bucket_by", the character length must be greater than or equal to 1.')
319
+ end
320
+
321
+ pattern = Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
322
+ if !@bucket_by.nil? && @bucket_by !~ pattern
323
+ invalid_properties.push("invalid value for \"bucket_by\", must conform to the pattern #{pattern}.")
324
+ end
325
+
326
+ if !@folder.nil? && @folder.to_s.length > 256
327
+ invalid_properties.push('invalid value for "folder", the character length must be smaller than or equal to 256.')
328
+ end
329
+
330
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
331
+ if !@folder.nil? && @folder !~ pattern
332
+ invalid_properties.push("invalid value for \"folder\", must conform to the pattern #{pattern}.")
333
+ end
334
+
335
+ if !@allocation_pct.nil? && @allocation_pct > 10000
336
+ invalid_properties.push('invalid value for "allocation_pct", must be smaller than or equal to 10000.')
337
+ end
338
+
339
+ if !@allocation_pct.nil? && @allocation_pct < 0
340
+ invalid_properties.push('invalid value for "allocation_pct", must be greater than or equal to 0.')
341
+ end
342
+
343
+ if !@allocation_percent.nil? && @allocation_percent > 100
344
+ invalid_properties.push('invalid value for "allocation_percent", must be smaller than or equal to 100.')
345
+ end
346
+
347
+ if !@allocation_percent.nil? && @allocation_percent < 0
348
+ invalid_properties.push('invalid value for "allocation_percent", must be greater than or equal to 0.')
349
+ end
350
+
351
+ if !@salt.nil? && @salt.to_s.length > 64
352
+ invalid_properties.push('invalid value for "salt", the character length must be smaller than or equal to 64.')
353
+ end
354
+
355
+ if !@salt.nil? && @salt.to_s.length < 1
356
+ invalid_properties.push('invalid value for "salt", the character length must be greater than or equal to 1.')
357
+ end
358
+
359
+ if !@groups.nil? && @groups.length < 2
360
+ invalid_properties.push('invalid value for "groups", number of items must be greater than or equal to 2.')
361
+ end
362
+
363
+ if !@significance_threshold.nil? && @significance_threshold > 0.5
364
+ invalid_properties.push('invalid value for "significance_threshold", must be smaller than or equal to 0.5.')
365
+ end
366
+
367
+ if !@significance_threshold.nil? && @significance_threshold < 0.00010
368
+ invalid_properties.push('invalid value for "significance_threshold", must be greater than or equal to 0.00010.')
369
+ end
370
+
371
+ if !@min_runtime_days.nil? && @min_runtime_days > 365
372
+ invalid_properties.push('invalid value for "min_runtime_days", must be smaller than or equal to 365.')
373
+ end
374
+
375
+ if !@min_runtime_days.nil? && @min_runtime_days < 0
376
+ invalid_properties.push('invalid value for "min_runtime_days", must be greater than or equal to 0.')
377
+ end
378
+
379
+ if !@min_sample_size.nil? && @min_sample_size > 9007199254740991
380
+ invalid_properties.push('invalid value for "min_sample_size", must be smaller than or equal to 9007199254740991.')
381
+ end
382
+
383
+ if !@min_sample_size.nil? && @min_sample_size < 1
384
+ invalid_properties.push('invalid value for "min_sample_size", must be greater than or equal to 1.')
385
+ end
386
+
387
+ if !@guardrail_metrics.nil? && @guardrail_metrics.length > 10
388
+ invalid_properties.push('invalid value for "guardrail_metrics", number of items must be less than or equal to 10.')
389
+ end
390
+
391
+ invalid_properties
392
+ end
393
+
394
+ # Check to see if the all the properties in the model are valid
395
+ # @return true if the model is valid
396
+ def valid?
397
+ warn '[DEPRECATED] the `valid?` method is obsolete'
398
+ return false if !@name.nil? && @name.to_s.length > 128
399
+ return false if !@name.nil? && @name !~ Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
400
+ return false if !@description.nil? && @description.to_s.length > 2000
401
+ return false if !@hypothesis.nil? && @hypothesis.to_s.length > 4000
402
+ return false if !@tag.nil? && @tag.to_s.length > 64
403
+ return false if !@owner_email.nil? && @owner_email.to_s.length > 254
404
+ return false if !@audience.nil? && @audience.to_s.length > 256
405
+ return false if !@bucket_by.nil? && @bucket_by.to_s.length > 128
406
+ return false if !@bucket_by.nil? && @bucket_by.to_s.length < 1
407
+ return false if !@bucket_by.nil? && @bucket_by !~ Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
408
+ return false if !@folder.nil? && @folder.to_s.length > 256
409
+ return false if !@folder.nil? && @folder !~ Regexp.new(/^[a-zA-Z0-9_-]+$/)
410
+ return false if !@allocation_pct.nil? && @allocation_pct > 10000
411
+ return false if !@allocation_pct.nil? && @allocation_pct < 0
412
+ return false if !@allocation_percent.nil? && @allocation_percent > 100
413
+ return false if !@allocation_percent.nil? && @allocation_percent < 0
414
+ return false if !@salt.nil? && @salt.to_s.length > 64
415
+ return false if !@salt.nil? && @salt.to_s.length < 1
416
+ return false if !@groups.nil? && @groups.length < 2
417
+ return false if !@significance_threshold.nil? && @significance_threshold > 0.5
418
+ return false if !@significance_threshold.nil? && @significance_threshold < 0.00010
419
+ return false if !@min_runtime_days.nil? && @min_runtime_days > 365
420
+ return false if !@min_runtime_days.nil? && @min_runtime_days < 0
421
+ return false if !@min_sample_size.nil? && @min_sample_size > 9007199254740991
422
+ return false if !@min_sample_size.nil? && @min_sample_size < 1
423
+ return false if !@guardrail_metrics.nil? && @guardrail_metrics.length > 10
424
+ true
425
+ end
426
+
427
+ # Custom attribute writer method with validation
428
+ # @param [Object] name Value to be assigned
429
+ def name=(name)
430
+ if name.nil?
431
+ fail ArgumentError, 'name cannot be nil'
432
+ end
433
+
434
+ if name.to_s.length > 128
435
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
436
+ end
437
+
438
+ pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
439
+ if name !~ pattern
440
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
441
+ end
442
+
443
+ @name = name
444
+ end
445
+
446
+ # Custom attribute writer method with validation
447
+ # @param [Object] description Value to be assigned
448
+ def description=(description)
449
+ if !description.nil? && description.to_s.length > 2000
450
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2000.'
451
+ end
452
+
453
+ @description = description
454
+ end
455
+
456
+ # Custom attribute writer method with validation
457
+ # @param [Object] hypothesis Value to be assigned
458
+ def hypothesis=(hypothesis)
459
+ if !hypothesis.nil? && hypothesis.to_s.length > 4000
460
+ fail ArgumentError, 'invalid value for "hypothesis", the character length must be smaller than or equal to 4000.'
461
+ end
462
+
463
+ @hypothesis = hypothesis
464
+ end
465
+
466
+ # Custom attribute writer method with validation
467
+ # @param [Object] tag Value to be assigned
468
+ def tag=(tag)
469
+ if !tag.nil? && tag.to_s.length > 64
470
+ fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 64.'
471
+ end
472
+
473
+ @tag = tag
474
+ end
475
+
476
+ # Custom attribute writer method with validation
477
+ # @param [Object] owner_email Value to be assigned
478
+ def owner_email=(owner_email)
479
+ if !owner_email.nil? && owner_email.to_s.length > 254
480
+ fail ArgumentError, 'invalid value for "owner_email", the character length must be smaller than or equal to 254.'
481
+ end
482
+
483
+ @owner_email = owner_email
484
+ end
485
+
486
+ # Custom attribute writer method with validation
487
+ # @param [Object] audience Value to be assigned
488
+ def audience=(audience)
489
+ if !audience.nil? && audience.to_s.length > 256
490
+ fail ArgumentError, 'invalid value for "audience", the character length must be smaller than or equal to 256.'
491
+ end
492
+
493
+ @audience = audience
494
+ end
495
+
496
+ # Custom attribute writer method with validation
497
+ # @param [Object] bucket_by Value to be assigned
498
+ def bucket_by=(bucket_by)
499
+ if !bucket_by.nil? && bucket_by.to_s.length > 128
500
+ fail ArgumentError, 'invalid value for "bucket_by", the character length must be smaller than or equal to 128.'
501
+ end
502
+
503
+ if !bucket_by.nil? && bucket_by.to_s.length < 1
504
+ fail ArgumentError, 'invalid value for "bucket_by", the character length must be greater than or equal to 1.'
505
+ end
506
+
507
+ pattern = Regexp.new(/^[a-zA-Z_][a-zA-Z0-9_]*$/)
508
+ if !bucket_by.nil? && bucket_by !~ pattern
509
+ fail ArgumentError, "invalid value for \"bucket_by\", must conform to the pattern #{pattern}."
510
+ end
511
+
512
+ @bucket_by = bucket_by
513
+ end
514
+
515
+ # Custom attribute writer method with validation
516
+ # @param [Object] folder Value to be assigned
517
+ def folder=(folder)
518
+ if !folder.nil? && folder.to_s.length > 256
519
+ fail ArgumentError, 'invalid value for "folder", the character length must be smaller than or equal to 256.'
520
+ end
521
+
522
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
523
+ if !folder.nil? && folder !~ pattern
524
+ fail ArgumentError, "invalid value for \"folder\", must conform to the pattern #{pattern}."
525
+ end
526
+
527
+ @folder = folder
528
+ end
529
+
530
+ # Custom attribute writer method with validation
531
+ # @param [Object] allocation_pct Value to be assigned
532
+ def allocation_pct=(allocation_pct)
533
+ if allocation_pct.nil?
534
+ fail ArgumentError, 'allocation_pct cannot be nil'
535
+ end
536
+
537
+ if allocation_pct > 10000
538
+ fail ArgumentError, 'invalid value for "allocation_pct", must be smaller than or equal to 10000.'
539
+ end
540
+
541
+ if allocation_pct < 0
542
+ fail ArgumentError, 'invalid value for "allocation_pct", must be greater than or equal to 0.'
543
+ end
544
+
545
+ @allocation_pct = allocation_pct
546
+ end
547
+
548
+ # Custom attribute writer method with validation
549
+ # @param [Object] allocation_percent Value to be assigned
550
+ def allocation_percent=(allocation_percent)
551
+ if allocation_percent.nil?
552
+ fail ArgumentError, 'allocation_percent cannot be nil'
553
+ end
554
+
555
+ if allocation_percent > 100
556
+ fail ArgumentError, 'invalid value for "allocation_percent", must be smaller than or equal to 100.'
557
+ end
558
+
559
+ if allocation_percent < 0
560
+ fail ArgumentError, 'invalid value for "allocation_percent", must be greater than or equal to 0.'
561
+ end
562
+
563
+ @allocation_percent = allocation_percent
564
+ end
565
+
566
+ # Custom attribute writer method with validation
567
+ # @param [Object] salt Value to be assigned
568
+ def salt=(salt)
569
+ if salt.nil?
570
+ fail ArgumentError, 'salt cannot be nil'
571
+ end
572
+
573
+ if salt.to_s.length > 64
574
+ fail ArgumentError, 'invalid value for "salt", the character length must be smaller than or equal to 64.'
575
+ end
576
+
577
+ if salt.to_s.length < 1
578
+ fail ArgumentError, 'invalid value for "salt", the character length must be greater than or equal to 1.'
579
+ end
580
+
581
+ @salt = salt
582
+ end
583
+
584
+ # Custom attribute writer method with validation
585
+ # @param [Object] groups Value to be assigned
586
+ def groups=(groups)
587
+ if groups.nil?
588
+ fail ArgumentError, 'groups cannot be nil'
589
+ end
590
+
591
+ if groups.length < 2
592
+ fail ArgumentError, 'invalid value for "groups", number of items must be greater than or equal to 2.'
593
+ end
594
+
595
+ @groups = groups
596
+ end
597
+
598
+ # Custom attribute writer method with validation
599
+ # @param [Object] significance_threshold Value to be assigned
600
+ def significance_threshold=(significance_threshold)
601
+ if significance_threshold.nil?
602
+ fail ArgumentError, 'significance_threshold cannot be nil'
603
+ end
604
+
605
+ if significance_threshold > 0.5
606
+ fail ArgumentError, 'invalid value for "significance_threshold", must be smaller than or equal to 0.5.'
607
+ end
608
+
609
+ if significance_threshold < 0.00010
610
+ fail ArgumentError, 'invalid value for "significance_threshold", must be greater than or equal to 0.00010.'
611
+ end
612
+
613
+ @significance_threshold = significance_threshold
614
+ end
615
+
616
+ # Custom attribute writer method with validation
617
+ # @param [Object] min_runtime_days Value to be assigned
618
+ def min_runtime_days=(min_runtime_days)
619
+ if min_runtime_days.nil?
620
+ fail ArgumentError, 'min_runtime_days cannot be nil'
621
+ end
622
+
623
+ if min_runtime_days > 365
624
+ fail ArgumentError, 'invalid value for "min_runtime_days", must be smaller than or equal to 365.'
625
+ end
626
+
627
+ if min_runtime_days < 0
628
+ fail ArgumentError, 'invalid value for "min_runtime_days", must be greater than or equal to 0.'
629
+ end
630
+
631
+ @min_runtime_days = min_runtime_days
632
+ end
633
+
634
+ # Custom attribute writer method with validation
635
+ # @param [Object] min_sample_size Value to be assigned
636
+ def min_sample_size=(min_sample_size)
637
+ if min_sample_size.nil?
638
+ fail ArgumentError, 'min_sample_size cannot be nil'
639
+ end
640
+
641
+ if min_sample_size > 9007199254740991
642
+ fail ArgumentError, 'invalid value for "min_sample_size", must be smaller than or equal to 9007199254740991.'
643
+ end
644
+
645
+ if min_sample_size < 1
646
+ fail ArgumentError, 'invalid value for "min_sample_size", must be greater than or equal to 1.'
647
+ end
648
+
649
+ @min_sample_size = min_sample_size
650
+ end
651
+
652
+ # Custom attribute writer method with validation
653
+ # @param [Object] guardrail_metrics Value to be assigned
654
+ def guardrail_metrics=(guardrail_metrics)
655
+ if guardrail_metrics.nil?
656
+ fail ArgumentError, 'guardrail_metrics cannot be nil'
657
+ end
658
+
659
+ if guardrail_metrics.length > 10
660
+ fail ArgumentError, 'invalid value for "guardrail_metrics", number of items must be less than or equal to 10.'
661
+ end
662
+
663
+ @guardrail_metrics = guardrail_metrics
664
+ end
665
+
666
+ # Checks equality by comparing each attribute.
667
+ # @param [Object] Object to be compared
668
+ def ==(o)
669
+ return true if self.equal?(o)
670
+ self.class == o.class &&
671
+ name == o.name &&
672
+ description == o.description &&
673
+ hypothesis == o.hypothesis &&
674
+ tag == o.tag &&
675
+ owner_email == o.owner_email &&
676
+ audience == o.audience &&
677
+ bucket_by == o.bucket_by &&
678
+ folder == o.folder &&
679
+ targeting_gate == o.targeting_gate &&
680
+ allocation_pct == o.allocation_pct &&
681
+ allocation_percent == o.allocation_percent &&
682
+ salt == o.salt &&
683
+ universe == o.universe &&
684
+ params == o.params &&
685
+ groups == o.groups &&
686
+ significance_threshold == o.significance_threshold &&
687
+ min_runtime_days == o.min_runtime_days &&
688
+ min_sample_size == o.min_sample_size &&
689
+ sequential_testing == o.sequential_testing &&
690
+ goal_metric == o.goal_metric &&
691
+ guardrail_metrics == o.guardrail_metrics
692
+ end
693
+
694
+ # @see the `==` method
695
+ # @param [Object] Object to be compared
696
+ def eql?(o)
697
+ self == o
698
+ end
699
+
700
+ # Calculates hash code according to all attributes.
701
+ # @return [Integer] Hash code
702
+ def hash
703
+ [name, description, hypothesis, tag, owner_email, audience, bucket_by, folder, targeting_gate, allocation_pct, allocation_percent, salt, universe, params, groups, significance_threshold, min_runtime_days, min_sample_size, sequential_testing, goal_metric, guardrail_metrics].hash
704
+ end
705
+
706
+ # Builds the object from hash
707
+ # @param [Hash] attributes Model attributes in the form of hash
708
+ # @return [Object] Returns the model itself
709
+ def self.build_from_hash(attributes)
710
+ return nil unless attributes.is_a?(Hash)
711
+ attributes = attributes.transform_keys(&:to_sym)
712
+ transformed_hash = {}
713
+ openapi_types.each_pair do |key, type|
714
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
715
+ transformed_hash["#{key}"] = nil
716
+ elsif type =~ /\AArray<(.*)>/i
717
+ # check to ensure the input is an array given that the attribute
718
+ # is documented as an array but the input is not
719
+ if attributes[attribute_map[key]].is_a?(Array)
720
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
721
+ end
722
+ elsif !attributes[attribute_map[key]].nil?
723
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
724
+ end
725
+ end
726
+ new(transformed_hash)
727
+ end
728
+
729
+ # Returns the object in the form of hash
730
+ # @return [Hash] Returns the object in the form of hash
731
+ def to_hash
732
+ hash = {}
733
+ self.class.attribute_map.each_pair do |attr, param|
734
+ value = self.send(attr)
735
+ if value.nil?
736
+ is_nullable = self.class.openapi_nullable.include?(attr)
737
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
738
+ end
739
+
740
+ hash[param] = _to_hash(value)
741
+ end
742
+ hash
743
+ end
744
+
745
+ end
746
+
747
+ end