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,298 @@
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
+ # The condition of a metric-rule alert.
18
+ class OpsAlertRuleSummary < ApiModelBase
19
+ # Alert-rule id.
20
+ attr_accessor :id
21
+
22
+ # Alert-rule name.
23
+ attr_accessor :name
24
+
25
+ # How `observedValue` is compared to `threshold`.
26
+ attr_accessor :comparator
27
+
28
+ # The threshold value the rule fires on.
29
+ attr_accessor :threshold
30
+
31
+ # Rolling evaluation window in hours.
32
+ attr_accessor :window_hours
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'name' => :'name',
61
+ :'comparator' => :'comparator',
62
+ :'threshold' => :'threshold',
63
+ :'window_hours' => :'windowHours'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'id' => :'String',
81
+ :'name' => :'String',
82
+ :'comparator' => :'String',
83
+ :'threshold' => :'Float',
84
+ :'window_hours' => :'Float'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsAlertRuleSummary` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ acceptable_attribute_map = self.class.acceptable_attribute_map
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!acceptable_attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsAlertRuleSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ else
113
+ self.id = nil
114
+ end
115
+
116
+ if attributes.key?(:'name')
117
+ self.name = attributes[:'name']
118
+ else
119
+ self.name = nil
120
+ end
121
+
122
+ if attributes.key?(:'comparator')
123
+ self.comparator = attributes[:'comparator']
124
+ else
125
+ self.comparator = nil
126
+ end
127
+
128
+ if attributes.key?(:'threshold')
129
+ self.threshold = attributes[:'threshold']
130
+ else
131
+ self.threshold = nil
132
+ end
133
+
134
+ if attributes.key?(:'window_hours')
135
+ self.window_hours = attributes[:'window_hours']
136
+ else
137
+ self.window_hours = nil
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
+ invalid_properties = Array.new
146
+ if @id.nil?
147
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
148
+ end
149
+
150
+ if @name.nil?
151
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
152
+ end
153
+
154
+ if @comparator.nil?
155
+ invalid_properties.push('invalid value for "comparator", comparator cannot be nil.')
156
+ end
157
+
158
+ if @threshold.nil?
159
+ invalid_properties.push('invalid value for "threshold", threshold cannot be nil.')
160
+ end
161
+
162
+ if @window_hours.nil?
163
+ invalid_properties.push('invalid value for "window_hours", window_hours cannot be nil.')
164
+ end
165
+
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
+ return false if @id.nil?
174
+ return false if @name.nil?
175
+ return false if @comparator.nil?
176
+ comparator_validator = EnumAttributeValidator.new('String', ["gt", "gte", "lt", "lte"])
177
+ return false unless comparator_validator.valid?(@comparator)
178
+ return false if @threshold.nil?
179
+ return false if @window_hours.nil?
180
+ true
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] id Value to be assigned
185
+ def id=(id)
186
+ if id.nil?
187
+ fail ArgumentError, 'id cannot be nil'
188
+ end
189
+
190
+ @id = id
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] name Value to be assigned
195
+ def name=(name)
196
+ if name.nil?
197
+ fail ArgumentError, 'name cannot be nil'
198
+ end
199
+
200
+ @name = name
201
+ end
202
+
203
+ # Custom attribute writer method checking allowed values (enum).
204
+ # @param [Object] comparator Object to be assigned
205
+ def comparator=(comparator)
206
+ validator = EnumAttributeValidator.new('String', ["gt", "gte", "lt", "lte"])
207
+ unless validator.valid?(comparator)
208
+ fail ArgumentError, "invalid value for \"comparator\", must be one of #{validator.allowable_values}."
209
+ end
210
+ @comparator = comparator
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] threshold Value to be assigned
215
+ def threshold=(threshold)
216
+ if threshold.nil?
217
+ fail ArgumentError, 'threshold cannot be nil'
218
+ end
219
+
220
+ @threshold = threshold
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] window_hours Value to be assigned
225
+ def window_hours=(window_hours)
226
+ if window_hours.nil?
227
+ fail ArgumentError, 'window_hours cannot be nil'
228
+ end
229
+
230
+ @window_hours = window_hours
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ id == o.id &&
239
+ name == o.name &&
240
+ comparator == o.comparator &&
241
+ threshold == o.threshold &&
242
+ window_hours == o.window_hours
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Integer] Hash code
253
+ def hash
254
+ [id, name, comparator, threshold, window_hours].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def self.build_from_hash(attributes)
261
+ return nil unless attributes.is_a?(Hash)
262
+ attributes = attributes.transform_keys(&:to_sym)
263
+ transformed_hash = {}
264
+ openapi_types.each_pair do |key, type|
265
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
266
+ transformed_hash["#{key}"] = nil
267
+ elsif type =~ /\AArray<(.*)>/i
268
+ # check to ensure the input is an array given that the attribute
269
+ # is documented as an array but the input is not
270
+ if attributes[attribute_map[key]].is_a?(Array)
271
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
272
+ end
273
+ elsif !attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
275
+ end
276
+ end
277
+ new(transformed_hash)
278
+ end
279
+
280
+ # Returns the object in the form of hash
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_hash
283
+ hash = {}
284
+ self.class.attribute_map.each_pair do |attr, param|
285
+ value = self.send(attr)
286
+ if value.nil?
287
+ is_nullable = self.class.openapi_nullable.include?(attr)
288
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
289
+ end
290
+
291
+ hash[param] = _to_hash(value)
292
+ end
293
+ hash
294
+ end
295
+
296
+ end
297
+
298
+ end
@@ -0,0 +1,172 @@
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
+ # Auto-collected browser environment for a `bug`/`feature_request`, captured at file time.
18
+ class OpsBrowserContext < ApiModelBase
19
+ # URL of the page the report was filed from, or `null`.
20
+ attr_accessor :page_url
21
+
22
+ # Reporter's user-agent string, or `null`.
23
+ attr_accessor :user_agent
24
+
25
+ # Reporter's viewport (e.g. `1280x720`), or `null`.
26
+ attr_accessor :viewport
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'page_url' => :'pageUrl',
32
+ :'user_agent' => :'userAgent',
33
+ :'viewport' => :'viewport'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'page_url' => :'String',
51
+ :'user_agent' => :'String',
52
+ :'viewport' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'page_url',
60
+ :'user_agent',
61
+ :'viewport'
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsBrowserContext` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsBrowserContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'page_url')
82
+ self.page_url = attributes[:'page_url']
83
+ end
84
+
85
+ if attributes.key?(:'user_agent')
86
+ self.user_agent = attributes[:'user_agent']
87
+ end
88
+
89
+ if attributes.key?(:'viewport')
90
+ self.viewport = attributes[:'viewport']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ page_url == o.page_url &&
115
+ user_agent == o.user_agent &&
116
+ viewport == o.viewport
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [page_url, user_agent, viewport].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ attributes = attributes.transform_keys(&:to_sym)
137
+ transformed_hash = {}
138
+ openapi_types.each_pair do |key, type|
139
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = nil
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[attribute_map[key]].is_a?(Array)
145
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
146
+ end
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
149
+ end
150
+ end
151
+ new(transformed_hash)
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ if value.nil?
161
+ is_nullable = self.class.openapi_nullable.include?(attr)
162
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
163
+ end
164
+
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ end
171
+
172
+ end