shipeasy-sdk 4.2.0 → 4.4.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/shipeasy/sdk/version.rb +1 -1
  3. data/lib/shipeasy_admin/api/flags_api.rb +9 -9
  4. data/lib/shipeasy_admin/api/killswitch_api.rb +1 -1
  5. data/lib/shipeasy_admin/api/ops_api.rb +127 -1
  6. data/lib/shipeasy_admin/api_client.rb +1 -1
  7. data/lib/shipeasy_admin/api_error.rb +1 -1
  8. data/lib/shipeasy_admin/api_model_base.rb +1 -1
  9. data/lib/shipeasy_admin/configuration.rb +1 -1
  10. data/lib/shipeasy_admin/models/add_to_gate_whitelist_request.rb +1 -1
  11. data/lib/shipeasy_admin/models/connector_data.rb +157 -0
  12. data/lib/shipeasy_admin/models/create_public_bug_request.rb +30 -2
  13. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +30 -2
  14. data/lib/shipeasy_admin/models/create_public_ticket_response.rb +1 -1
  15. data/lib/shipeasy_admin/models/env.rb +1 -1
  16. data/lib/shipeasy_admin/models/error.rb +1 -1
  17. data/lib/shipeasy_admin/models/error_code.rb +1 -1
  18. data/lib/shipeasy_admin/models/gate_whitelist.rb +1 -1
  19. data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +1 -1
  20. data/lib/shipeasy_admin/models/github_connector_data.rb +170 -0
  21. data/lib/shipeasy_admin/models/github_connector_data_issue.rb +257 -0
  22. data/lib/shipeasy_admin/models/github_pr_link.rb +319 -0
  23. data/lib/shipeasy_admin/models/killswitch_value.rb +1 -1
  24. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +593 -0
  25. data/lib/shipeasy_admin/models/measure_plan_resource.rb +228 -0
  26. data/lib/shipeasy_admin/models/measure_plan_step.rb +211 -0
  27. data/lib/shipeasy_admin/models/notification_target.rb +1 -1
  28. data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +1 -1
  29. data/lib/shipeasy_admin/models/ops_alert_context.rb +350 -0
  30. data/lib/shipeasy_admin/models/ops_alert_metric_summary.rb +222 -0
  31. data/lib/shipeasy_admin/models/ops_alert_rule_summary.rb +298 -0
  32. data/lib/shipeasy_admin/models/ops_browser_context.rb +172 -0
  33. data/lib/shipeasy_admin/models/ops_error_context.rb +429 -0
  34. data/lib/shipeasy_admin/models/ops_investigation_state.rb +48 -0
  35. data/lib/shipeasy_admin/models/ops_item_context.rb +193 -0
  36. data/lib/shipeasy_admin/models/ops_item_context_error_chart.rb +222 -0
  37. data/lib/shipeasy_admin/models/ops_item_context_error_chart_series_inner.rb +193 -0
  38. data/lib/shipeasy_admin/models/ops_item_owner.rb +163 -0
  39. data/lib/shipeasy_admin/models/ops_item_owner_agent.rb +255 -0
  40. data/lib/shipeasy_admin/models/ops_item_owner_user.rb +206 -0
  41. data/lib/shipeasy_admin/models/ops_item_priority.rb +1 -1
  42. data/lib/shipeasy_admin/models/ops_item_status.rb +1 -1
  43. data/lib/shipeasy_admin/models/ops_measure_plan_context.rb +220 -0
  44. data/lib/shipeasy_admin/models/ops_reporter_context.rb +328 -0
  45. data/lib/shipeasy_admin/models/ops_reporter_experiment.rb +230 -0
  46. data/lib/shipeasy_admin/models/ops_reporter_flag.rb +193 -0
  47. data/lib/shipeasy_admin/models/ops_reporter_killswitch.rb +205 -0
  48. data/lib/shipeasy_admin/models/ops_run.rb +309 -0
  49. data/lib/shipeasy_admin/models/ops_run_action.rb +42 -0
  50. data/lib/shipeasy_admin/models/ops_run_action_or_null.rb +146 -0
  51. data/lib/shipeasy_admin/models/remove_from_gate_whitelist_request.rb +1 -1
  52. data/lib/shipeasy_admin/models/set_gate_whitelist_request.rb +1 -1
  53. data/lib/shipeasy_admin/models/slack_connector_data.rb +148 -0
  54. data/lib/shipeasy_admin/models/slack_connector_data_message.rb +203 -0
  55. data/lib/shipeasy_admin/models/toggle_killswitch_request.rb +1 -1
  56. data/lib/shipeasy_admin/models/toggle_killswitch_response.rb +1 -1
  57. data/lib/shipeasy_admin/version.rb +1 -1
  58. data/lib/shipeasy_admin.rb +30 -1
  59. metadata +35 -6
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #Shipeasy Admin API (server-SDK surface)
3
+
4
+ #The slice of the Shipeasy admin API that the published server SDKs expose as their optional `AdminClient`. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Four capabilities, nothing else: - **List the ops queue** — read the project's tickets, filtered by type, status, priority, owner, reporter (`reporter`) and close time (`closedSince`). - **File a public ticket** — a bug or a feature request onto the project's ops queue. - **Toggle a kill switch** — flip the switch itself, or one of its named sub-switches, on one environment. - **Manage a flag's whitelist** — read, replace, add to, or remove from the allowlist that admits specific identities ahead of every targeting rule. Everything else in the admin API is reachable through the Shipeasy CLI and MCP server, which speak the complete contract (`openapi.yaml`).
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
+ # An assistant-proposed measurement plan: what it already built, what it still needs, and the event instrumentation you implement.
18
+ class OpsMeasurePlanContext < ApiModelBase
19
+ # The customer's underlying intent in their own words — WHAT they want to learn or achieve and WHY, independent of the specific steps. The plan below is a best-effort proposal made without repo access; when the code reveals a better path, this goal is the target you optimize for, not literal step-adherence.
20
+ attr_accessor :goal
21
+
22
+ # Resources the assistant already created on approval (live now) — don't recreate them.
23
+ attr_accessor :created
24
+
25
+ # Resources the assistant couldn't create yet (usually a metric whose backing event isn't emitted); create these after the instrumentation lands.
26
+ attr_accessor :pending
27
+
28
+ # The code instrumentation to implement before the metrics can collect data.
29
+ attr_accessor :instrumentation
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'goal' => :'goal',
35
+ :'created' => :'created',
36
+ :'pending' => :'pending',
37
+ :'instrumentation' => :'instrumentation'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'goal' => :'String',
55
+ :'created' => :'Array<MeasurePlanResource>',
56
+ :'pending' => :'Array<MeasurePlanResource>',
57
+ :'instrumentation' => :'Array<MeasurePlanStep>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'goal',
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsMeasurePlanContext` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsMeasurePlanContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'goal')
85
+ self.goal = attributes[:'goal']
86
+ end
87
+
88
+ if attributes.key?(:'created')
89
+ if (value = attributes[:'created']).is_a?(Array)
90
+ self.created = value
91
+ end
92
+ else
93
+ self.created = nil
94
+ end
95
+
96
+ if attributes.key?(:'pending')
97
+ if (value = attributes[:'pending']).is_a?(Array)
98
+ self.pending = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'instrumentation')
103
+ if (value = attributes[:'instrumentation']).is_a?(Array)
104
+ self.instrumentation = value
105
+ end
106
+ else
107
+ self.instrumentation = nil
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @created.nil?
117
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
118
+ end
119
+
120
+ if @instrumentation.nil?
121
+ invalid_properties.push('invalid value for "instrumentation", instrumentation cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @created.nil?
132
+ return false if @instrumentation.nil?
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] created Value to be assigned
138
+ def created=(created)
139
+ if created.nil?
140
+ fail ArgumentError, 'created cannot be nil'
141
+ end
142
+
143
+ @created = created
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] instrumentation Value to be assigned
148
+ def instrumentation=(instrumentation)
149
+ if instrumentation.nil?
150
+ fail ArgumentError, 'instrumentation cannot be nil'
151
+ end
152
+
153
+ @instrumentation = instrumentation
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ goal == o.goal &&
162
+ created == o.created &&
163
+ pending == o.pending &&
164
+ instrumentation == o.instrumentation
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [goal, created, pending, instrumentation].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,328 @@
1
+ =begin
2
+ #Shipeasy Admin API (server-SDK surface)
3
+
4
+ #The slice of the Shipeasy admin API that the published server SDKs expose as their optional `AdminClient`. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Four capabilities, nothing else: - **List the ops queue** — read the project's tickets, filtered by type, status, priority, owner, reporter (`reporter`) and close time (`closedSince`). - **File a public ticket** — a bug or a feature request onto the project's ops queue. - **Toggle a kill switch** — flip the switch itself, or one of its named sub-switches, on one environment. - **Manage a flag's whitelist** — read, replace, add to, or remove from the allowlist that admits specific identities ahead of every targeting rule. Everything else in the admin API is reachable through the Shipeasy CLI and MCP server, which speak the complete contract (`openapi.yaml`).
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
+ # Who filed a public bug/feature request and what they had on. Present only when the report carried the reporter's SDK identity (`user`): Shipeasy evaluates every flag, kill switch and running experiment for that user at filing time — the same evaluation the SDK runs, without per-browser devtools overrides — and keeps the result here. It is a point-in-time snapshot: a flag flipped since then is not reflected.
18
+ class OpsReporterContext < ApiModelBase
19
+ # A reporter's SDK user attributes, keyed by attribute name — the same map your app passes to the SDK to evaluate flags. At most 50 attributes; each value is a string (≤500 chars), number, boolean, `null` (treated as unset) or a flat array of those scalars (≤50 entries) — anything else is rejected with a 400. `user_id` or `anonymous_id` is the bucketing unit.
20
+ attr_accessor :user
21
+
22
+ # The environment the snapshot was evaluated against — the filing client key's environment.
23
+ attr_accessor :env
24
+
25
+ # When the snapshot was taken (the moment the report was filed, or last re-triggered).
26
+ attr_accessor :evaluated_at
27
+
28
+ # Feature flags that evaluated ON for the reporter.
29
+ attr_accessor :flags
30
+
31
+ # Kill switches that were engaged when the report was filed.
32
+ attr_accessor :killswitches
33
+
34
+ # Running experiments the reporter was enrolled in, with their assigned group.
35
+ attr_accessor :experiments
36
+
37
+ # `true` when a list hit its 200-entry cap and was cut short.
38
+ attr_accessor :truncated
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'user' => :'user',
44
+ :'env' => :'env',
45
+ :'evaluated_at' => :'evaluatedAt',
46
+ :'flags' => :'flags',
47
+ :'killswitches' => :'killswitches',
48
+ :'experiments' => :'experiments',
49
+ :'truncated' => :'truncated'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'user' => :'Hash<String, Object>',
67
+ :'env' => :'String',
68
+ :'evaluated_at' => :'Time',
69
+ :'flags' => :'Array<OpsReporterFlag>',
70
+ :'killswitches' => :'Array<OpsReporterKillswitch>',
71
+ :'experiments' => :'Array<OpsReporterExperiment>',
72
+ :'truncated' => :'Boolean'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsReporterContext` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsReporterContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'user')
99
+ if (value = attributes[:'user']).is_a?(Hash)
100
+ self.user = value
101
+ end
102
+ else
103
+ self.user = nil
104
+ end
105
+
106
+ if attributes.key?(:'env')
107
+ self.env = attributes[:'env']
108
+ else
109
+ self.env = nil
110
+ end
111
+
112
+ if attributes.key?(:'evaluated_at')
113
+ self.evaluated_at = attributes[:'evaluated_at']
114
+ else
115
+ self.evaluated_at = nil
116
+ end
117
+
118
+ if attributes.key?(:'flags')
119
+ if (value = attributes[:'flags']).is_a?(Array)
120
+ self.flags = value
121
+ end
122
+ else
123
+ self.flags = nil
124
+ end
125
+
126
+ if attributes.key?(:'killswitches')
127
+ if (value = attributes[:'killswitches']).is_a?(Array)
128
+ self.killswitches = value
129
+ end
130
+ else
131
+ self.killswitches = nil
132
+ end
133
+
134
+ if attributes.key?(:'experiments')
135
+ if (value = attributes[:'experiments']).is_a?(Array)
136
+ self.experiments = value
137
+ end
138
+ else
139
+ self.experiments = nil
140
+ end
141
+
142
+ if attributes.key?(:'truncated')
143
+ self.truncated = attributes[:'truncated']
144
+ end
145
+ end
146
+
147
+ # Show invalid properties with the reasons. Usually used together with valid?
148
+ # @return Array for valid properties with the reasons
149
+ def list_invalid_properties
150
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
151
+ invalid_properties = Array.new
152
+ if @user.nil?
153
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
154
+ end
155
+
156
+ if @user.length > 50
157
+ invalid_properties.push('invalid value for "user", number of items must be less than or equal to 50.')
158
+ end
159
+
160
+ if @env.nil?
161
+ invalid_properties.push('invalid value for "env", env cannot be nil.')
162
+ end
163
+
164
+ if @evaluated_at.nil?
165
+ invalid_properties.push('invalid value for "evaluated_at", evaluated_at cannot be nil.')
166
+ end
167
+
168
+ if @flags.nil?
169
+ invalid_properties.push('invalid value for "flags", flags cannot be nil.')
170
+ end
171
+
172
+ if @killswitches.nil?
173
+ invalid_properties.push('invalid value for "killswitches", killswitches cannot be nil.')
174
+ end
175
+
176
+ if @experiments.nil?
177
+ invalid_properties.push('invalid value for "experiments", experiments cannot be nil.')
178
+ end
179
+
180
+ invalid_properties
181
+ end
182
+
183
+ # Check to see if the all the properties in the model are valid
184
+ # @return true if the model is valid
185
+ def valid?
186
+ warn '[DEPRECATED] the `valid?` method is obsolete'
187
+ return false if @user.nil?
188
+ return false if @user.length > 50
189
+ return false if @env.nil?
190
+ return false if @evaluated_at.nil?
191
+ return false if @flags.nil?
192
+ return false if @killswitches.nil?
193
+ return false if @experiments.nil?
194
+ true
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] user Value to be assigned
199
+ def user=(user)
200
+ if user.nil?
201
+ fail ArgumentError, 'user cannot be nil'
202
+ end
203
+
204
+ if user.length > 50
205
+ fail ArgumentError, 'invalid value for "user", number of items must be less than or equal to 50.'
206
+ end
207
+
208
+ @user = user
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] env Value to be assigned
213
+ def env=(env)
214
+ if env.nil?
215
+ fail ArgumentError, 'env cannot be nil'
216
+ end
217
+
218
+ @env = env
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] evaluated_at Value to be assigned
223
+ def evaluated_at=(evaluated_at)
224
+ if evaluated_at.nil?
225
+ fail ArgumentError, 'evaluated_at cannot be nil'
226
+ end
227
+
228
+ @evaluated_at = evaluated_at
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] flags Value to be assigned
233
+ def flags=(flags)
234
+ if flags.nil?
235
+ fail ArgumentError, 'flags cannot be nil'
236
+ end
237
+
238
+ @flags = flags
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] killswitches Value to be assigned
243
+ def killswitches=(killswitches)
244
+ if killswitches.nil?
245
+ fail ArgumentError, 'killswitches cannot be nil'
246
+ end
247
+
248
+ @killswitches = killswitches
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] experiments Value to be assigned
253
+ def experiments=(experiments)
254
+ if experiments.nil?
255
+ fail ArgumentError, 'experiments cannot be nil'
256
+ end
257
+
258
+ @experiments = experiments
259
+ end
260
+
261
+ # Checks equality by comparing each attribute.
262
+ # @param [Object] Object to be compared
263
+ def ==(o)
264
+ return true if self.equal?(o)
265
+ self.class == o.class &&
266
+ user == o.user &&
267
+ env == o.env &&
268
+ evaluated_at == o.evaluated_at &&
269
+ flags == o.flags &&
270
+ killswitches == o.killswitches &&
271
+ experiments == o.experiments &&
272
+ truncated == o.truncated
273
+ end
274
+
275
+ # @see the `==` method
276
+ # @param [Object] Object to be compared
277
+ def eql?(o)
278
+ self == o
279
+ end
280
+
281
+ # Calculates hash code according to all attributes.
282
+ # @return [Integer] Hash code
283
+ def hash
284
+ [user, env, evaluated_at, flags, killswitches, experiments, truncated].hash
285
+ end
286
+
287
+ # Builds the object from hash
288
+ # @param [Hash] attributes Model attributes in the form of hash
289
+ # @return [Object] Returns the model itself
290
+ def self.build_from_hash(attributes)
291
+ return nil unless attributes.is_a?(Hash)
292
+ attributes = attributes.transform_keys(&:to_sym)
293
+ transformed_hash = {}
294
+ openapi_types.each_pair do |key, type|
295
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
296
+ transformed_hash["#{key}"] = nil
297
+ elsif type =~ /\AArray<(.*)>/i
298
+ # check to ensure the input is an array given that the attribute
299
+ # is documented as an array but the input is not
300
+ if attributes[attribute_map[key]].is_a?(Array)
301
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
302
+ end
303
+ elsif !attributes[attribute_map[key]].nil?
304
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
305
+ end
306
+ end
307
+ new(transformed_hash)
308
+ end
309
+
310
+ # Returns the object in the form of hash
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_hash
313
+ hash = {}
314
+ self.class.attribute_map.each_pair do |attr, param|
315
+ value = self.send(attr)
316
+ if value.nil?
317
+ is_nullable = self.class.openapi_nullable.include?(attr)
318
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
319
+ end
320
+
321
+ hash[param] = _to_hash(value)
322
+ end
323
+ hash
324
+ end
325
+
326
+ end
327
+
328
+ end