shipeasy-sdk 4.1.0 → 4.3.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 (55) 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 +21 -2
  13. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +21 -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 +184 -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_run.rb +309 -0
  45. data/lib/shipeasy_admin/models/ops_run_action.rb +42 -0
  46. data/lib/shipeasy_admin/models/ops_run_action_or_null.rb +146 -0
  47. data/lib/shipeasy_admin/models/remove_from_gate_whitelist_request.rb +1 -1
  48. data/lib/shipeasy_admin/models/set_gate_whitelist_request.rb +1 -1
  49. data/lib/shipeasy_admin/models/slack_connector_data.rb +148 -0
  50. data/lib/shipeasy_admin/models/slack_connector_data_message.rb +203 -0
  51. data/lib/shipeasy_admin/models/toggle_killswitch_request.rb +1 -1
  52. data/lib/shipeasy_admin/models/toggle_killswitch_response.rb +1 -1
  53. data/lib/shipeasy_admin/version.rb +1 -1
  54. data/lib/shipeasy_admin.rb +26 -1
  55. metadata +31 -6
@@ -0,0 +1,429 @@
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
+ # Hydrated detail for an auto-filed `error` ticket, read from the tracked `errors` row at request time (so `count`/`lastSeenAt` reflect the latest state).
18
+ class OpsErrorContext < ApiModelBase
19
+ # The tracked `errors` row id (fetch full detail via `related.error`).
20
+ attr_accessor :id
21
+
22
+ # Stable dedupe key of the tracked error.
23
+ attr_accessor :fingerprint
24
+
25
+ # Fingerprint of the upstream issue this error descends from (set when the same error was reported at an inner boundary first), or `null` for a root issue.
26
+ attr_accessor :caused_by_fingerprint
27
+
28
+ # Error class/name, e.g. `TypeError`, or `null` when the source didn't supply one.
29
+ attr_accessor :error_type
30
+
31
+ # The error message.
32
+ attr_accessor :message
33
+
34
+ # The `see()` consequence subject — the `causes_the(<subject>)` value. Grep the codebase for this to find the throw site. `null` if the error was never instrumented.
35
+ attr_accessor :subject
36
+
37
+ # The `see()` consequence outcome — the `.to(<outcome>)` value. `null` if uninstrumented.
38
+ attr_accessor :outcome
39
+
40
+ # `see()` error kind: `caught` | `uncaught` | `unhandled_rejection` | `network` | `violation`.
41
+ attr_accessor :kind
42
+
43
+ # Which SDK side reported it: `client` | `server`.
44
+ attr_accessor :side
45
+
46
+ # Published env the reporting SDK ran against (dev/staging/prod).
47
+ attr_accessor :env
48
+
49
+ # Folded occurrence count for this fingerprint.
50
+ attr_accessor :count
51
+
52
+ # ISO-8601 timestamp of the first occurrence.
53
+ attr_accessor :first_seen_at
54
+
55
+ # ISO-8601 timestamp of the most recent occurrence.
56
+ attr_accessor :last_seen_at
57
+
58
+ # Distinct, id-normalized routes this error has surfaced on (UUIDs/ids collapsed to `#`).
59
+ attr_accessor :seen_urls
60
+
61
+ # The last 3 non-empty lines of the latest occurrence's stack — the innermost frames closest to where the throw bubbled out, baked in as an at-a-glance locator. `null` when the source supplied no stack. Fetch the full stack via `related.error`.
62
+ attr_accessor :stack_tail
63
+
64
+ # @shipeasy/sdk version of the latest occurrence, or `null`.
65
+ attr_accessor :sdk_version
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'id' => :'id',
71
+ :'fingerprint' => :'fingerprint',
72
+ :'caused_by_fingerprint' => :'causedByFingerprint',
73
+ :'error_type' => :'errorType',
74
+ :'message' => :'message',
75
+ :'subject' => :'subject',
76
+ :'outcome' => :'outcome',
77
+ :'kind' => :'kind',
78
+ :'side' => :'side',
79
+ :'env' => :'env',
80
+ :'count' => :'count',
81
+ :'first_seen_at' => :'firstSeenAt',
82
+ :'last_seen_at' => :'lastSeenAt',
83
+ :'seen_urls' => :'seenUrls',
84
+ :'stack_tail' => :'stackTail',
85
+ :'sdk_version' => :'sdkVersion'
86
+ }
87
+ end
88
+
89
+ # Returns attribute mapping this model knows about
90
+ def self.acceptable_attribute_map
91
+ attribute_map
92
+ end
93
+
94
+ # Returns all the JSON keys this model knows about
95
+ def self.acceptable_attributes
96
+ acceptable_attribute_map.values
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.openapi_types
101
+ {
102
+ :'id' => :'String',
103
+ :'fingerprint' => :'String',
104
+ :'caused_by_fingerprint' => :'String',
105
+ :'error_type' => :'String',
106
+ :'message' => :'String',
107
+ :'subject' => :'String',
108
+ :'outcome' => :'String',
109
+ :'kind' => :'String',
110
+ :'side' => :'String',
111
+ :'env' => :'String',
112
+ :'count' => :'Float',
113
+ :'first_seen_at' => :'String',
114
+ :'last_seen_at' => :'String',
115
+ :'seen_urls' => :'Array<String>',
116
+ :'stack_tail' => :'String',
117
+ :'sdk_version' => :'String'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ :'caused_by_fingerprint',
125
+ :'error_type',
126
+ :'subject',
127
+ :'outcome',
128
+ :'kind',
129
+ :'side',
130
+ :'env',
131
+ :'stack_tail',
132
+ :'sdk_version'
133
+ ])
134
+ end
135
+
136
+ # Initializes the object
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ def initialize(attributes = {})
139
+ if (!attributes.is_a?(Hash))
140
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsErrorContext` initialize method"
141
+ end
142
+
143
+ # check to see if the attribute exists and convert string to symbol for hash key
144
+ acceptable_attribute_map = self.class.acceptable_attribute_map
145
+ attributes = attributes.each_with_object({}) { |(k, v), h|
146
+ if (!acceptable_attribute_map.key?(k.to_sym))
147
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsErrorContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
148
+ end
149
+ h[k.to_sym] = v
150
+ }
151
+
152
+ if attributes.key?(:'id')
153
+ self.id = attributes[:'id']
154
+ else
155
+ self.id = nil
156
+ end
157
+
158
+ if attributes.key?(:'fingerprint')
159
+ self.fingerprint = attributes[:'fingerprint']
160
+ else
161
+ self.fingerprint = nil
162
+ end
163
+
164
+ if attributes.key?(:'caused_by_fingerprint')
165
+ self.caused_by_fingerprint = attributes[:'caused_by_fingerprint']
166
+ end
167
+
168
+ if attributes.key?(:'error_type')
169
+ self.error_type = attributes[:'error_type']
170
+ end
171
+
172
+ if attributes.key?(:'message')
173
+ self.message = attributes[:'message']
174
+ else
175
+ self.message = nil
176
+ end
177
+
178
+ if attributes.key?(:'subject')
179
+ self.subject = attributes[:'subject']
180
+ end
181
+
182
+ if attributes.key?(:'outcome')
183
+ self.outcome = attributes[:'outcome']
184
+ end
185
+
186
+ if attributes.key?(:'kind')
187
+ self.kind = attributes[:'kind']
188
+ end
189
+
190
+ if attributes.key?(:'side')
191
+ self.side = attributes[:'side']
192
+ end
193
+
194
+ if attributes.key?(:'env')
195
+ self.env = attributes[:'env']
196
+ end
197
+
198
+ if attributes.key?(:'count')
199
+ self.count = attributes[:'count']
200
+ else
201
+ self.count = nil
202
+ end
203
+
204
+ if attributes.key?(:'first_seen_at')
205
+ self.first_seen_at = attributes[:'first_seen_at']
206
+ else
207
+ self.first_seen_at = nil
208
+ end
209
+
210
+ if attributes.key?(:'last_seen_at')
211
+ self.last_seen_at = attributes[:'last_seen_at']
212
+ else
213
+ self.last_seen_at = nil
214
+ end
215
+
216
+ if attributes.key?(:'seen_urls')
217
+ if (value = attributes[:'seen_urls']).is_a?(Array)
218
+ self.seen_urls = value
219
+ end
220
+ else
221
+ self.seen_urls = nil
222
+ end
223
+
224
+ if attributes.key?(:'stack_tail')
225
+ self.stack_tail = attributes[:'stack_tail']
226
+ end
227
+
228
+ if attributes.key?(:'sdk_version')
229
+ self.sdk_version = attributes[:'sdk_version']
230
+ end
231
+ end
232
+
233
+ # Show invalid properties with the reasons. Usually used together with valid?
234
+ # @return Array for valid properties with the reasons
235
+ def list_invalid_properties
236
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
237
+ invalid_properties = Array.new
238
+ if @id.nil?
239
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
240
+ end
241
+
242
+ if @fingerprint.nil?
243
+ invalid_properties.push('invalid value for "fingerprint", fingerprint cannot be nil.')
244
+ end
245
+
246
+ if @message.nil?
247
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
248
+ end
249
+
250
+ if @count.nil?
251
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
252
+ end
253
+
254
+ if @first_seen_at.nil?
255
+ invalid_properties.push('invalid value for "first_seen_at", first_seen_at cannot be nil.')
256
+ end
257
+
258
+ if @last_seen_at.nil?
259
+ invalid_properties.push('invalid value for "last_seen_at", last_seen_at cannot be nil.')
260
+ end
261
+
262
+ if @seen_urls.nil?
263
+ invalid_properties.push('invalid value for "seen_urls", seen_urls cannot be nil.')
264
+ end
265
+
266
+ invalid_properties
267
+ end
268
+
269
+ # Check to see if the all the properties in the model are valid
270
+ # @return true if the model is valid
271
+ def valid?
272
+ warn '[DEPRECATED] the `valid?` method is obsolete'
273
+ return false if @id.nil?
274
+ return false if @fingerprint.nil?
275
+ return false if @message.nil?
276
+ return false if @count.nil?
277
+ return false if @first_seen_at.nil?
278
+ return false if @last_seen_at.nil?
279
+ return false if @seen_urls.nil?
280
+ true
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] id Value to be assigned
285
+ def id=(id)
286
+ if id.nil?
287
+ fail ArgumentError, 'id cannot be nil'
288
+ end
289
+
290
+ @id = id
291
+ end
292
+
293
+ # Custom attribute writer method with validation
294
+ # @param [Object] fingerprint Value to be assigned
295
+ def fingerprint=(fingerprint)
296
+ if fingerprint.nil?
297
+ fail ArgumentError, 'fingerprint cannot be nil'
298
+ end
299
+
300
+ @fingerprint = fingerprint
301
+ end
302
+
303
+ # Custom attribute writer method with validation
304
+ # @param [Object] message Value to be assigned
305
+ def message=(message)
306
+ if message.nil?
307
+ fail ArgumentError, 'message cannot be nil'
308
+ end
309
+
310
+ @message = message
311
+ end
312
+
313
+ # Custom attribute writer method with validation
314
+ # @param [Object] count Value to be assigned
315
+ def count=(count)
316
+ if count.nil?
317
+ fail ArgumentError, 'count cannot be nil'
318
+ end
319
+
320
+ @count = count
321
+ end
322
+
323
+ # Custom attribute writer method with validation
324
+ # @param [Object] first_seen_at Value to be assigned
325
+ def first_seen_at=(first_seen_at)
326
+ if first_seen_at.nil?
327
+ fail ArgumentError, 'first_seen_at cannot be nil'
328
+ end
329
+
330
+ @first_seen_at = first_seen_at
331
+ end
332
+
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] last_seen_at Value to be assigned
335
+ def last_seen_at=(last_seen_at)
336
+ if last_seen_at.nil?
337
+ fail ArgumentError, 'last_seen_at cannot be nil'
338
+ end
339
+
340
+ @last_seen_at = last_seen_at
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] seen_urls Value to be assigned
345
+ def seen_urls=(seen_urls)
346
+ if seen_urls.nil?
347
+ fail ArgumentError, 'seen_urls cannot be nil'
348
+ end
349
+
350
+ @seen_urls = seen_urls
351
+ end
352
+
353
+ # Checks equality by comparing each attribute.
354
+ # @param [Object] Object to be compared
355
+ def ==(o)
356
+ return true if self.equal?(o)
357
+ self.class == o.class &&
358
+ id == o.id &&
359
+ fingerprint == o.fingerprint &&
360
+ caused_by_fingerprint == o.caused_by_fingerprint &&
361
+ error_type == o.error_type &&
362
+ message == o.message &&
363
+ subject == o.subject &&
364
+ outcome == o.outcome &&
365
+ kind == o.kind &&
366
+ side == o.side &&
367
+ env == o.env &&
368
+ count == o.count &&
369
+ first_seen_at == o.first_seen_at &&
370
+ last_seen_at == o.last_seen_at &&
371
+ seen_urls == o.seen_urls &&
372
+ stack_tail == o.stack_tail &&
373
+ sdk_version == o.sdk_version
374
+ end
375
+
376
+ # @see the `==` method
377
+ # @param [Object] Object to be compared
378
+ def eql?(o)
379
+ self == o
380
+ end
381
+
382
+ # Calculates hash code according to all attributes.
383
+ # @return [Integer] Hash code
384
+ def hash
385
+ [id, fingerprint, caused_by_fingerprint, error_type, message, subject, outcome, kind, side, env, count, first_seen_at, last_seen_at, seen_urls, stack_tail, sdk_version].hash
386
+ end
387
+
388
+ # Builds the object from hash
389
+ # @param [Hash] attributes Model attributes in the form of hash
390
+ # @return [Object] Returns the model itself
391
+ def self.build_from_hash(attributes)
392
+ return nil unless attributes.is_a?(Hash)
393
+ attributes = attributes.transform_keys(&:to_sym)
394
+ transformed_hash = {}
395
+ openapi_types.each_pair do |key, type|
396
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
397
+ transformed_hash["#{key}"] = nil
398
+ elsif type =~ /\AArray<(.*)>/i
399
+ # check to ensure the input is an array given that the attribute
400
+ # is documented as an array but the input is not
401
+ if attributes[attribute_map[key]].is_a?(Array)
402
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
403
+ end
404
+ elsif !attributes[attribute_map[key]].nil?
405
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
406
+ end
407
+ end
408
+ new(transformed_hash)
409
+ end
410
+
411
+ # Returns the object in the form of hash
412
+ # @return [Hash] Returns the object in the form of hash
413
+ def to_hash
414
+ hash = {}
415
+ self.class.attribute_map.each_pair do |attr, param|
416
+ value = self.send(attr)
417
+ if value.nil?
418
+ is_nullable = self.class.openapi_nullable.include?(attr)
419
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
420
+ end
421
+
422
+ hash[param] = _to_hash(value)
423
+ end
424
+ hash
425
+ end
426
+
427
+ end
428
+
429
+ end
@@ -0,0 +1,48 @@
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
+ class OpsInvestigationState
18
+ PR_READY = "pr_ready".freeze
19
+ PR_MERGED = "pr_merged".freeze
20
+ PR_CLOSED = "pr_closed".freeze
21
+ INVESTIGATED = "investigated".freeze
22
+ DETECTED = "detected".freeze
23
+ QUESTION = "question".freeze
24
+ READY_FOR_QA = "ready_for_qa".freeze
25
+ PENDING_APPROVAL = "pending_approval".freeze
26
+ WORKING = "working".freeze
27
+ BACKLOG = "backlog".freeze
28
+
29
+ def self.all_vars
30
+ @all_vars ||= [PR_READY, PR_MERGED, PR_CLOSED, INVESTIGATED, DETECTED, QUESTION, READY_FOR_QA, PENDING_APPROVAL, WORKING, BACKLOG].freeze
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def self.build_from_hash(value)
37
+ new.build_from_hash(value)
38
+ end
39
+
40
+ # Builds the enum from string
41
+ # @param [String] The enum value in the form of the string
42
+ # @return [String] The enum value
43
+ def build_from_hash(value)
44
+ return value if OpsInvestigationState.all_vars.include?(value)
45
+ raise "Invalid ENUM value #{value} for class #OpsInvestigationState"
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,184 @@
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
+ # Per-type capture context on a queue item. Exactly one of `browser` (bug/feature), `error`, `alert`, or `measurePlan` is populated depending on `type`; other keys (e.g. the AI dedupe block on bugs) may also be present.
18
+ class OpsItemContext < ApiModelBase
19
+ attr_accessor :browser
20
+
21
+ attr_accessor :error
22
+
23
+ attr_accessor :alert
24
+
25
+ attr_accessor :measure_plan
26
+
27
+ attr_accessor :error_chart
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'browser' => :'browser',
33
+ :'error' => :'error',
34
+ :'alert' => :'alert',
35
+ :'measure_plan' => :'measurePlan',
36
+ :'error_chart' => :'errorChart'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'browser' => :'OpsBrowserContext',
54
+ :'error' => :'OpsErrorContext',
55
+ :'alert' => :'OpsAlertContext',
56
+ :'measure_plan' => :'OpsMeasurePlanContext',
57
+ :'error_chart' => :'OpsItemContextErrorChart'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsItemContext` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsItemContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'browser')
84
+ self.browser = attributes[:'browser']
85
+ end
86
+
87
+ if attributes.key?(:'error')
88
+ self.error = attributes[:'error']
89
+ end
90
+
91
+ if attributes.key?(:'alert')
92
+ self.alert = attributes[:'alert']
93
+ end
94
+
95
+ if attributes.key?(:'measure_plan')
96
+ self.measure_plan = attributes[:'measure_plan']
97
+ end
98
+
99
+ if attributes.key?(:'error_chart')
100
+ self.error_chart = attributes[:'error_chart']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ browser == o.browser &&
125
+ error == o.error &&
126
+ alert == o.alert &&
127
+ measure_plan == o.measure_plan &&
128
+ error_chart == o.error_chart
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [browser, error, alert, measure_plan, error_chart].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ if value.nil?
173
+ is_nullable = self.class.openapi_nullable.include?(attr)
174
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
+ end
176
+
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ end
183
+
184
+ end