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.
- checksums.yaml +4 -4
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/flags_api.rb +9 -9
- data/lib/shipeasy_admin/api/killswitch_api.rb +1 -1
- data/lib/shipeasy_admin/api/ops_api.rb +127 -1
- data/lib/shipeasy_admin/api_client.rb +1 -1
- data/lib/shipeasy_admin/api_error.rb +1 -1
- data/lib/shipeasy_admin/api_model_base.rb +1 -1
- data/lib/shipeasy_admin/configuration.rb +1 -1
- data/lib/shipeasy_admin/models/add_to_gate_whitelist_request.rb +1 -1
- data/lib/shipeasy_admin/models/connector_data.rb +157 -0
- data/lib/shipeasy_admin/models/create_public_bug_request.rb +1 -1
- data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +1 -1
- data/lib/shipeasy_admin/models/create_public_ticket_response.rb +1 -1
- data/lib/shipeasy_admin/models/env.rb +1 -1
- data/lib/shipeasy_admin/models/error.rb +1 -1
- data/lib/shipeasy_admin/models/error_code.rb +1 -1
- data/lib/shipeasy_admin/models/gate_whitelist.rb +1 -1
- data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +1 -1
- data/lib/shipeasy_admin/models/github_connector_data.rb +170 -0
- data/lib/shipeasy_admin/models/github_connector_data_issue.rb +257 -0
- data/lib/shipeasy_admin/models/github_pr_link.rb +319 -0
- data/lib/shipeasy_admin/models/killswitch_value.rb +1 -1
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +593 -0
- data/lib/shipeasy_admin/models/measure_plan_resource.rb +228 -0
- data/lib/shipeasy_admin/models/measure_plan_step.rb +211 -0
- data/lib/shipeasy_admin/models/notification_target.rb +1 -1
- data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +1 -1
- data/lib/shipeasy_admin/models/ops_alert_context.rb +350 -0
- data/lib/shipeasy_admin/models/ops_alert_metric_summary.rb +222 -0
- data/lib/shipeasy_admin/models/ops_alert_rule_summary.rb +298 -0
- data/lib/shipeasy_admin/models/ops_browser_context.rb +172 -0
- data/lib/shipeasy_admin/models/ops_error_context.rb +429 -0
- data/lib/shipeasy_admin/models/ops_investigation_state.rb +48 -0
- data/lib/shipeasy_admin/models/ops_item_context.rb +184 -0
- data/lib/shipeasy_admin/models/ops_item_context_error_chart.rb +222 -0
- data/lib/shipeasy_admin/models/ops_item_context_error_chart_series_inner.rb +193 -0
- data/lib/shipeasy_admin/models/ops_item_owner.rb +163 -0
- data/lib/shipeasy_admin/models/ops_item_owner_agent.rb +255 -0
- data/lib/shipeasy_admin/models/ops_item_owner_user.rb +206 -0
- data/lib/shipeasy_admin/models/ops_item_priority.rb +1 -1
- data/lib/shipeasy_admin/models/ops_item_status.rb +1 -1
- data/lib/shipeasy_admin/models/ops_measure_plan_context.rb +220 -0
- data/lib/shipeasy_admin/models/ops_run.rb +309 -0
- data/lib/shipeasy_admin/models/ops_run_action.rb +42 -0
- data/lib/shipeasy_admin/models/ops_run_action_or_null.rb +146 -0
- data/lib/shipeasy_admin/models/remove_from_gate_whitelist_request.rb +1 -1
- data/lib/shipeasy_admin/models/set_gate_whitelist_request.rb +1 -1
- data/lib/shipeasy_admin/models/slack_connector_data.rb +148 -0
- data/lib/shipeasy_admin/models/slack_connector_data_message.rb +203 -0
- data/lib/shipeasy_admin/models/toggle_killswitch_request.rb +1 -1
- data/lib/shipeasy_admin/models/toggle_killswitch_response.rb +1 -1
- data/lib/shipeasy_admin/version.rb +1 -1
- data/lib/shipeasy_admin.rb +26 -1
- metadata +31 -6
|
@@ -0,0 +1,350 @@
|
|
|
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
|
+
# Detail for an `alert` ticket — the fired-alert INSTANCE this ticket is. List rows carry the stored capture subset (`source`, `dedupeKey`, `ruleId`, `detail`, `href`, `observedValue`); the single-item read hydrates the rest, resolving `severity`/`status` off the ticket itself and the rule → metric → event chain at request time.
|
|
18
|
+
class OpsAlertContext < ApiModelBase
|
|
19
|
+
# What kind of condition opened this alert instance.
|
|
20
|
+
attr_accessor :source
|
|
21
|
+
|
|
22
|
+
# Stable per-condition key; with `source` forms the ticket's `sourceRef`.
|
|
23
|
+
attr_accessor :dedupe_key
|
|
24
|
+
|
|
25
|
+
# The instance's one-line reading — the observed condition in words.
|
|
26
|
+
attr_accessor :detail
|
|
27
|
+
|
|
28
|
+
# Id of the alert rule that opened this instance, or `null` for a built-in condition.
|
|
29
|
+
attr_accessor :rule_id
|
|
30
|
+
|
|
31
|
+
# How loud the alert is. Severity belongs to the RULE and is carried by this ticket as `priority`; it is DERIVED from that on the hydrated single-item read, and absent from the raw stored context list rows return.
|
|
32
|
+
attr_accessor :severity
|
|
33
|
+
|
|
34
|
+
# The metric value that tripped the rule, or `null`.
|
|
35
|
+
attr_accessor :observed_value
|
|
36
|
+
|
|
37
|
+
# Dashboard deep link to the alert, or `null`.
|
|
38
|
+
attr_accessor :href
|
|
39
|
+
|
|
40
|
+
# Firing state of this instance, projected from the ticket's own status (`active` while it is open, i.e. while the condition holds). Absent from the raw stored context list rows return.
|
|
41
|
+
attr_accessor :status
|
|
42
|
+
|
|
43
|
+
# ISO-8601 timestamp the alert became active, or `null`.
|
|
44
|
+
attr_accessor :active_since
|
|
45
|
+
|
|
46
|
+
# ISO-8601 timestamp the alert cleared, or `null` while still active.
|
|
47
|
+
attr_accessor :resolved_at
|
|
48
|
+
|
|
49
|
+
# The alert rule condition that tripped (metric-rule alerts only); `null` for SRM/peek/guardrail alerts with no rule.
|
|
50
|
+
attr_accessor :rule
|
|
51
|
+
|
|
52
|
+
# The metric the alert watches, hydrated with its backing event(s); `null` if not resolvable.
|
|
53
|
+
attr_accessor :metric
|
|
54
|
+
|
|
55
|
+
class EnumAttributeValidator
|
|
56
|
+
attr_reader :datatype
|
|
57
|
+
attr_reader :allowable_values
|
|
58
|
+
|
|
59
|
+
def initialize(datatype, allowable_values)
|
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
|
61
|
+
case datatype.to_s
|
|
62
|
+
when /Integer/i
|
|
63
|
+
value.to_i
|
|
64
|
+
when /Float/i
|
|
65
|
+
value.to_f
|
|
66
|
+
else
|
|
67
|
+
value
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def valid?(value)
|
|
73
|
+
!value || allowable_values.include?(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
78
|
+
def self.attribute_map
|
|
79
|
+
{
|
|
80
|
+
:'source' => :'source',
|
|
81
|
+
:'dedupe_key' => :'dedupeKey',
|
|
82
|
+
:'detail' => :'detail',
|
|
83
|
+
:'rule_id' => :'ruleId',
|
|
84
|
+
:'severity' => :'severity',
|
|
85
|
+
:'observed_value' => :'observedValue',
|
|
86
|
+
:'href' => :'href',
|
|
87
|
+
:'status' => :'status',
|
|
88
|
+
:'active_since' => :'activeSince',
|
|
89
|
+
:'resolved_at' => :'resolvedAt',
|
|
90
|
+
:'rule' => :'rule',
|
|
91
|
+
:'metric' => :'metric'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Returns attribute mapping this model knows about
|
|
96
|
+
def self.acceptable_attribute_map
|
|
97
|
+
attribute_map
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Returns all the JSON keys this model knows about
|
|
101
|
+
def self.acceptable_attributes
|
|
102
|
+
acceptable_attribute_map.values
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Attribute type mapping.
|
|
106
|
+
def self.openapi_types
|
|
107
|
+
{
|
|
108
|
+
:'source' => :'String',
|
|
109
|
+
:'dedupe_key' => :'String',
|
|
110
|
+
:'detail' => :'String',
|
|
111
|
+
:'rule_id' => :'String',
|
|
112
|
+
:'severity' => :'String',
|
|
113
|
+
:'observed_value' => :'Float',
|
|
114
|
+
:'href' => :'String',
|
|
115
|
+
:'status' => :'String',
|
|
116
|
+
:'active_since' => :'String',
|
|
117
|
+
:'resolved_at' => :'String',
|
|
118
|
+
:'rule' => :'OpsAlertRuleSummary',
|
|
119
|
+
:'metric' => :'OpsAlertMetricSummary'
|
|
120
|
+
}
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# List of attributes with nullable: true
|
|
124
|
+
def self.openapi_nullable
|
|
125
|
+
Set.new([
|
|
126
|
+
:'detail',
|
|
127
|
+
:'rule_id',
|
|
128
|
+
:'observed_value',
|
|
129
|
+
:'href',
|
|
130
|
+
:'status',
|
|
131
|
+
:'active_since',
|
|
132
|
+
:'resolved_at',
|
|
133
|
+
:'rule',
|
|
134
|
+
:'metric'
|
|
135
|
+
])
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Initializes the object
|
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
140
|
+
def initialize(attributes = {})
|
|
141
|
+
if (!attributes.is_a?(Hash))
|
|
142
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsAlertContext` initialize method"
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
146
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
147
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
148
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
149
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsAlertContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
150
|
+
end
|
|
151
|
+
h[k.to_sym] = v
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'source')
|
|
155
|
+
self.source = attributes[:'source']
|
|
156
|
+
else
|
|
157
|
+
self.source = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'dedupe_key')
|
|
161
|
+
self.dedupe_key = attributes[:'dedupe_key']
|
|
162
|
+
else
|
|
163
|
+
self.dedupe_key = nil
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'detail')
|
|
167
|
+
self.detail = attributes[:'detail']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'rule_id')
|
|
171
|
+
self.rule_id = attributes[:'rule_id']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'severity')
|
|
175
|
+
self.severity = attributes[:'severity']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'observed_value')
|
|
179
|
+
self.observed_value = attributes[:'observed_value']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'href')
|
|
183
|
+
self.href = attributes[:'href']
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'status')
|
|
187
|
+
self.status = attributes[:'status']
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if attributes.key?(:'active_since')
|
|
191
|
+
self.active_since = attributes[:'active_since']
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'resolved_at')
|
|
195
|
+
self.resolved_at = attributes[:'resolved_at']
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'rule')
|
|
199
|
+
self.rule = attributes[:'rule']
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if attributes.key?(:'metric')
|
|
203
|
+
self.metric = attributes[:'metric']
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
208
|
+
# @return Array for valid properties with the reasons
|
|
209
|
+
def list_invalid_properties
|
|
210
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
211
|
+
invalid_properties = Array.new
|
|
212
|
+
if @source.nil?
|
|
213
|
+
invalid_properties.push('invalid value for "source", source cannot be nil.')
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if @dedupe_key.nil?
|
|
217
|
+
invalid_properties.push('invalid value for "dedupe_key", dedupe_key cannot be nil.')
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
invalid_properties
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Check to see if the all the properties in the model are valid
|
|
224
|
+
# @return true if the model is valid
|
|
225
|
+
def valid?
|
|
226
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
227
|
+
return false if @source.nil?
|
|
228
|
+
source_validator = EnumAttributeValidator.new('String', ["metric_rule", "killswitch_armed", "experiment_srm", "experiment_peek", "guardrail"])
|
|
229
|
+
return false unless source_validator.valid?(@source)
|
|
230
|
+
return false if @dedupe_key.nil?
|
|
231
|
+
severity_validator = EnumAttributeValidator.new('String', ["danger", "warn", "info"])
|
|
232
|
+
return false unless severity_validator.valid?(@severity)
|
|
233
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "resolved", "dismissed"])
|
|
234
|
+
return false unless status_validator.valid?(@status)
|
|
235
|
+
true
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
239
|
+
# @param [Object] source Object to be assigned
|
|
240
|
+
def source=(source)
|
|
241
|
+
validator = EnumAttributeValidator.new('String', ["metric_rule", "killswitch_armed", "experiment_srm", "experiment_peek", "guardrail"])
|
|
242
|
+
unless validator.valid?(source)
|
|
243
|
+
fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}."
|
|
244
|
+
end
|
|
245
|
+
@source = source
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] dedupe_key Value to be assigned
|
|
250
|
+
def dedupe_key=(dedupe_key)
|
|
251
|
+
if dedupe_key.nil?
|
|
252
|
+
fail ArgumentError, 'dedupe_key cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@dedupe_key = dedupe_key
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
259
|
+
# @param [Object] severity Object to be assigned
|
|
260
|
+
def severity=(severity)
|
|
261
|
+
validator = EnumAttributeValidator.new('String', ["danger", "warn", "info"])
|
|
262
|
+
unless validator.valid?(severity)
|
|
263
|
+
fail ArgumentError, "invalid value for \"severity\", must be one of #{validator.allowable_values}."
|
|
264
|
+
end
|
|
265
|
+
@severity = severity
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
269
|
+
# @param [Object] status Object to be assigned
|
|
270
|
+
def status=(status)
|
|
271
|
+
validator = EnumAttributeValidator.new('String', ["active", "resolved", "dismissed"])
|
|
272
|
+
unless validator.valid?(status)
|
|
273
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
274
|
+
end
|
|
275
|
+
@status = status
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Checks equality by comparing each attribute.
|
|
279
|
+
# @param [Object] Object to be compared
|
|
280
|
+
def ==(o)
|
|
281
|
+
return true if self.equal?(o)
|
|
282
|
+
self.class == o.class &&
|
|
283
|
+
source == o.source &&
|
|
284
|
+
dedupe_key == o.dedupe_key &&
|
|
285
|
+
detail == o.detail &&
|
|
286
|
+
rule_id == o.rule_id &&
|
|
287
|
+
severity == o.severity &&
|
|
288
|
+
observed_value == o.observed_value &&
|
|
289
|
+
href == o.href &&
|
|
290
|
+
status == o.status &&
|
|
291
|
+
active_since == o.active_since &&
|
|
292
|
+
resolved_at == o.resolved_at &&
|
|
293
|
+
rule == o.rule &&
|
|
294
|
+
metric == o.metric
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# @see the `==` method
|
|
298
|
+
# @param [Object] Object to be compared
|
|
299
|
+
def eql?(o)
|
|
300
|
+
self == o
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Calculates hash code according to all attributes.
|
|
304
|
+
# @return [Integer] Hash code
|
|
305
|
+
def hash
|
|
306
|
+
[source, dedupe_key, detail, rule_id, severity, observed_value, href, status, active_since, resolved_at, rule, metric].hash
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Builds the object from hash
|
|
310
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
311
|
+
# @return [Object] Returns the model itself
|
|
312
|
+
def self.build_from_hash(attributes)
|
|
313
|
+
return nil unless attributes.is_a?(Hash)
|
|
314
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
315
|
+
transformed_hash = {}
|
|
316
|
+
openapi_types.each_pair do |key, type|
|
|
317
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
318
|
+
transformed_hash["#{key}"] = nil
|
|
319
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
320
|
+
# check to ensure the input is an array given that the attribute
|
|
321
|
+
# is documented as an array but the input is not
|
|
322
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
323
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
324
|
+
end
|
|
325
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
326
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
new(transformed_hash)
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Returns the object in the form of hash
|
|
333
|
+
# @return [Hash] Returns the object in the form of hash
|
|
334
|
+
def to_hash
|
|
335
|
+
hash = {}
|
|
336
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
337
|
+
value = self.send(attr)
|
|
338
|
+
if value.nil?
|
|
339
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
340
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
hash[param] = _to_hash(value)
|
|
344
|
+
end
|
|
345
|
+
hash
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
end
|
|
@@ -0,0 +1,222 @@
|
|
|
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 metric an alert watches, with its backing events.
|
|
18
|
+
class OpsAlertMetricSummary < ApiModelBase
|
|
19
|
+
# Metric id (fetch full detail via `related.metric`).
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Metric name.
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
# The event name(s) the metric aggregates over — one for count metrics, numerator + denominator for ratio metrics. Grep the codebase for `track('<event>')` on each to find the instrumentation feeding the metric.
|
|
26
|
+
attr_accessor :events
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'id' => :'id',
|
|
32
|
+
:'name' => :'name',
|
|
33
|
+
:'events' => :'events'
|
|
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
|
+
:'id' => :'String',
|
|
51
|
+
:'name' => :'String',
|
|
52
|
+
:'events' => :'Array<String>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsAlertMetricSummary` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsAlertMetricSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'id')
|
|
79
|
+
self.id = attributes[:'id']
|
|
80
|
+
else
|
|
81
|
+
self.id = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'name')
|
|
85
|
+
self.name = attributes[:'name']
|
|
86
|
+
else
|
|
87
|
+
self.name = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'events')
|
|
91
|
+
if (value = attributes[:'events']).is_a?(Array)
|
|
92
|
+
self.events = value
|
|
93
|
+
end
|
|
94
|
+
else
|
|
95
|
+
self.events = nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
if @id.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @name.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @events.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "events", events cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
invalid_properties
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Check to see if the all the properties in the model are valid
|
|
120
|
+
# @return true if the model is valid
|
|
121
|
+
def valid?
|
|
122
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
|
+
return false if @id.nil?
|
|
124
|
+
return false if @name.nil?
|
|
125
|
+
return false if @events.nil?
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] id Value to be assigned
|
|
131
|
+
def id=(id)
|
|
132
|
+
if id.nil?
|
|
133
|
+
fail ArgumentError, 'id cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@id = id
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] name Value to be assigned
|
|
141
|
+
def name=(name)
|
|
142
|
+
if name.nil?
|
|
143
|
+
fail ArgumentError, 'name cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@name = name
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] events Value to be assigned
|
|
151
|
+
def events=(events)
|
|
152
|
+
if events.nil?
|
|
153
|
+
fail ArgumentError, 'events cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@events = events
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Checks equality by comparing each attribute.
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def ==(o)
|
|
162
|
+
return true if self.equal?(o)
|
|
163
|
+
self.class == o.class &&
|
|
164
|
+
id == o.id &&
|
|
165
|
+
name == o.name &&
|
|
166
|
+
events == o.events
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[id, name, events].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_hash)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|