shipeasy-sdk 4.2.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 +1 -1
  13. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +1 -1
  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,170 @@
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
+ # GitHub connector trace — the issue it opened and, once linked, the pull requests.
18
+ class GithubConnectorData < ApiModelBase
19
+ attr_accessor :issue
20
+
21
+ # The item's PRIMARY linked pull request, derived from `prs`: the newest still-open one, else the newest merged one, else the newest closed one. Kept for readers that show one PR; `prs` is the full list.
22
+ attr_accessor :pr
23
+
24
+ # Every pull request linked to the item, oldest link first — an item can legitimately take several PRs (a fix split across repos, a follow-up). Absent on items linked before multi-PR support; `pr` then is the only one.
25
+ attr_accessor :prs
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'issue' => :'issue',
31
+ :'pr' => :'pr',
32
+ :'prs' => :'prs'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'issue' => :'GithubConnectorDataIssue',
50
+ :'pr' => :'GithubPrLink',
51
+ :'prs' => :'Array<GithubPrLink>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::GithubConnectorData` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::GithubConnectorData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'issue')
78
+ self.issue = attributes[:'issue']
79
+ end
80
+
81
+ if attributes.key?(:'pr')
82
+ self.pr = attributes[:'pr']
83
+ end
84
+
85
+ if attributes.key?(:'prs')
86
+ if (value = attributes[:'prs']).is_a?(Array)
87
+ self.prs = value
88
+ end
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ issue == o.issue &&
113
+ pr == o.pr &&
114
+ prs == o.prs
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [issue, pr, prs].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end
@@ -0,0 +1,257 @@
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 GitHub issue this item opened.
18
+ class GithubConnectorDataIssue < ApiModelBase
19
+ # GitHub issue number.
20
+ attr_accessor :number
21
+
22
+ # HTML URL of the opened issue.
23
+ attr_accessor :url
24
+
25
+ # Repository owner (org or user).
26
+ attr_accessor :owner
27
+
28
+ # Repository name.
29
+ attr_accessor :repo
30
+
31
+ # ISO-8601 timestamp the issue was opened.
32
+ attr_accessor :created_at
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'number' => :'number',
38
+ :'url' => :'url',
39
+ :'owner' => :'owner',
40
+ :'repo' => :'repo',
41
+ :'created_at' => :'createdAt'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'number' => :'Float',
59
+ :'url' => :'String',
60
+ :'owner' => :'String',
61
+ :'repo' => :'String',
62
+ :'created_at' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::GithubConnectorDataIssue` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::GithubConnectorDataIssue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'number')
89
+ self.number = attributes[:'number']
90
+ else
91
+ self.number = nil
92
+ end
93
+
94
+ if attributes.key?(:'url')
95
+ self.url = attributes[:'url']
96
+ else
97
+ self.url = nil
98
+ end
99
+
100
+ if attributes.key?(:'owner')
101
+ self.owner = attributes[:'owner']
102
+ else
103
+ self.owner = nil
104
+ end
105
+
106
+ if attributes.key?(:'repo')
107
+ self.repo = attributes[:'repo']
108
+ else
109
+ self.repo = nil
110
+ end
111
+
112
+ if attributes.key?(:'created_at')
113
+ self.created_at = attributes[:'created_at']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @number.nil?
123
+ invalid_properties.push('invalid value for "number", number cannot be nil.')
124
+ end
125
+
126
+ if @url.nil?
127
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
128
+ end
129
+
130
+ if @owner.nil?
131
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
132
+ end
133
+
134
+ if @repo.nil?
135
+ invalid_properties.push('invalid value for "repo", repo cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ return false if @number.nil?
146
+ return false if @url.nil?
147
+ return false if @owner.nil?
148
+ return false if @repo.nil?
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] number Value to be assigned
154
+ def number=(number)
155
+ if number.nil?
156
+ fail ArgumentError, 'number cannot be nil'
157
+ end
158
+
159
+ @number = number
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] url Value to be assigned
164
+ def url=(url)
165
+ if url.nil?
166
+ fail ArgumentError, 'url cannot be nil'
167
+ end
168
+
169
+ @url = url
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] owner Value to be assigned
174
+ def owner=(owner)
175
+ if owner.nil?
176
+ fail ArgumentError, 'owner cannot be nil'
177
+ end
178
+
179
+ @owner = owner
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] repo Value to be assigned
184
+ def repo=(repo)
185
+ if repo.nil?
186
+ fail ArgumentError, 'repo cannot be nil'
187
+ end
188
+
189
+ @repo = repo
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ number == o.number &&
198
+ url == o.url &&
199
+ owner == o.owner &&
200
+ repo == o.repo &&
201
+ created_at == o.created_at
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Integer] Hash code
212
+ def hash
213
+ [number, url, owner, repo, created_at].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def self.build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ transformed_hash = {}
223
+ openapi_types.each_pair do |key, type|
224
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = nil
226
+ elsif type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[attribute_map[key]].is_a?(Array)
230
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
231
+ end
232
+ elsif !attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
234
+ end
235
+ end
236
+ new(transformed_hash)
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ end
256
+
257
+ end