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,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
|
+
# Occurrence timeline for an `error` ticket — buckets over the project's error auto-close window (Settings → Errors: `errorAutocloseDays`, 7 days when auto-close is off, capped at 30) from the sampled occurrences, hydrated at read time by the single-item read only. Plotting exactly the quiet window that auto-resolves the error is what makes an empty right-hand edge meaningful. ABSENT (not `null`) on non-error tickets, on list rows (raw context), and when no occurrence landed in the window.
|
|
18
|
+
class OpsItemContextErrorChart < ApiModelBase
|
|
19
|
+
# Occurrence buckets, oldest first. Buckets with no occurrences are omitted.
|
|
20
|
+
attr_accessor :series
|
|
21
|
+
|
|
22
|
+
# Chart domain start — unix epoch milliseconds (the window's start).
|
|
23
|
+
attr_accessor :domain_from
|
|
24
|
+
|
|
25
|
+
# Chart domain end — unix epoch milliseconds (the read time).
|
|
26
|
+
attr_accessor :domain_to
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'series' => :'series',
|
|
32
|
+
:'domain_from' => :'domainFrom',
|
|
33
|
+
:'domain_to' => :'domainTo'
|
|
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
|
+
:'series' => :'Array<OpsItemContextErrorChartSeriesInner>',
|
|
51
|
+
:'domain_from' => :'Float',
|
|
52
|
+
:'domain_to' => :'Float'
|
|
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::OpsItemContextErrorChart` 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::OpsItemContextErrorChart`. 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?(:'series')
|
|
79
|
+
if (value = attributes[:'series']).is_a?(Array)
|
|
80
|
+
self.series = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.series = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'domain_from')
|
|
87
|
+
self.domain_from = attributes[:'domain_from']
|
|
88
|
+
else
|
|
89
|
+
self.domain_from = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'domain_to')
|
|
93
|
+
self.domain_to = attributes[:'domain_to']
|
|
94
|
+
else
|
|
95
|
+
self.domain_to = 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 @series.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "series", series cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @domain_from.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "domain_from", domain_from cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @domain_to.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "domain_to", domain_to 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 @series.nil?
|
|
124
|
+
return false if @domain_from.nil?
|
|
125
|
+
return false if @domain_to.nil?
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] series Value to be assigned
|
|
131
|
+
def series=(series)
|
|
132
|
+
if series.nil?
|
|
133
|
+
fail ArgumentError, 'series cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@series = series
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] domain_from Value to be assigned
|
|
141
|
+
def domain_from=(domain_from)
|
|
142
|
+
if domain_from.nil?
|
|
143
|
+
fail ArgumentError, 'domain_from cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@domain_from = domain_from
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] domain_to Value to be assigned
|
|
151
|
+
def domain_to=(domain_to)
|
|
152
|
+
if domain_to.nil?
|
|
153
|
+
fail ArgumentError, 'domain_to cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@domain_to = domain_to
|
|
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
|
+
series == o.series &&
|
|
165
|
+
domain_from == o.domain_from &&
|
|
166
|
+
domain_to == o.domain_to
|
|
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
|
+
[series, domain_from, domain_to].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
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
# One occurrence bucket.
|
|
18
|
+
class OpsItemContextErrorChartSeriesInner < ApiModelBase
|
|
19
|
+
# Bucket start — unix epoch **milliseconds**. Bucket width scales with the window (hourly up to ~5 days, coarser beyond).
|
|
20
|
+
attr_accessor :t
|
|
21
|
+
|
|
22
|
+
# Occurrence count in the bucket (sample-rate weighted).
|
|
23
|
+
attr_accessor :v
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'t' => :'t',
|
|
29
|
+
:'v' => :'v'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'t' => :'Float',
|
|
47
|
+
:'v' => :'Float'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsItemContextErrorChartSeriesInner` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsItemContextErrorChartSeriesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'t')
|
|
74
|
+
self.t = attributes[:'t']
|
|
75
|
+
else
|
|
76
|
+
self.t = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'v')
|
|
80
|
+
self.v = attributes[:'v']
|
|
81
|
+
else
|
|
82
|
+
self.v = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @t.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "t", t cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @v.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "v", v cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
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
|
+
return false if @t.nil?
|
|
107
|
+
return false if @v.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] t Value to be assigned
|
|
113
|
+
def t=(t)
|
|
114
|
+
if t.nil?
|
|
115
|
+
fail ArgumentError, 't cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@t = t
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] v Value to be assigned
|
|
123
|
+
def v=(v)
|
|
124
|
+
if v.nil?
|
|
125
|
+
fail ArgumentError, 'v cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@v = v
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
t == o.t &&
|
|
137
|
+
v == o.v
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[t, v].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
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 fully-resolved owner of a queue item — a person and/or an AI agent. The two halves are independent: an item may have a person, an agent, both, or neither (both `null`).
|
|
18
|
+
class OpsItemOwner < ApiModelBase
|
|
19
|
+
attr_accessor :user
|
|
20
|
+
|
|
21
|
+
attr_accessor :agent
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'user' => :'user',
|
|
27
|
+
:'agent' => :'agent'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'user' => :'OpsItemOwnerUser',
|
|
45
|
+
:'agent' => :'OpsItemOwnerAgent'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'user',
|
|
53
|
+
:'agent'
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::OpsItemOwner` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::OpsItemOwner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'user')
|
|
74
|
+
self.user = attributes[:'user']
|
|
75
|
+
else
|
|
76
|
+
self.user = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'agent')
|
|
80
|
+
self.agent = attributes[:'agent']
|
|
81
|
+
else
|
|
82
|
+
self.agent = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
invalid_properties
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Check to see if the all the properties in the model are valid
|
|
95
|
+
# @return true if the model is valid
|
|
96
|
+
def valid?
|
|
97
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
98
|
+
true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Checks equality by comparing each attribute.
|
|
102
|
+
# @param [Object] Object to be compared
|
|
103
|
+
def ==(o)
|
|
104
|
+
return true if self.equal?(o)
|
|
105
|
+
self.class == o.class &&
|
|
106
|
+
user == o.user &&
|
|
107
|
+
agent == o.agent
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# @see the `==` method
|
|
111
|
+
# @param [Object] Object to be compared
|
|
112
|
+
def eql?(o)
|
|
113
|
+
self == o
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Calculates hash code according to all attributes.
|
|
117
|
+
# @return [Integer] Hash code
|
|
118
|
+
def hash
|
|
119
|
+
[user, agent].hash
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Builds the object from hash
|
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
124
|
+
# @return [Object] Returns the model itself
|
|
125
|
+
def self.build_from_hash(attributes)
|
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
|
127
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
128
|
+
transformed_hash = {}
|
|
129
|
+
openapi_types.each_pair do |key, type|
|
|
130
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
131
|
+
transformed_hash["#{key}"] = nil
|
|
132
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
133
|
+
# check to ensure the input is an array given that the attribute
|
|
134
|
+
# is documented as an array but the input is not
|
|
135
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
136
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
137
|
+
end
|
|
138
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
139
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
new(transformed_hash)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Returns the object in the form of hash
|
|
146
|
+
# @return [Hash] Returns the object in the form of hash
|
|
147
|
+
def to_hash
|
|
148
|
+
hash = {}
|
|
149
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
150
|
+
value = self.send(attr)
|
|
151
|
+
if value.nil?
|
|
152
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
153
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
hash[param] = _to_hash(value)
|
|
157
|
+
end
|
|
158
|
+
hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|