hatchet-sdk 0.13.0 → 0.13.2
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/CHANGELOG.md +13 -0
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +15 -0
- data/lib/hatchet/clients/rest/README.md +26 -6
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/api_token_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/concurrency_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/sandbox_provider_api.rb +474 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/tenant_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/api_token.rb +16 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/create_api_token_request.rb +32 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role.rb +321 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role_list.rb +239 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability.rb +341 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability_list.rb +239 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_key.rb +1 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy.rb +1 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_totals.rb +320 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_sandbox_provider_request.rb +393 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider.rb +486 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_event.rb +374 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_event_kind.rb +46 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_event_list.rb +239 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_kind.rb +44 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_list.rb +231 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_sandbox_provider_status.rb +242 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_sandbox_provider_request.rb +329 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +15 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/worker/durable_event_listener.rb +7 -7
- metadata +17 -2
|
@@ -21,6 +21,9 @@ module HatchetSdkRest
|
|
|
21
21
|
# Limit the token to viewer access over REST and deny all gRPC calls. Defaults to false.
|
|
22
22
|
attr_accessor :read_only
|
|
23
23
|
|
|
24
|
+
# The capabilities that decide which REST operations and gRPC procedures the token can call, e.g. [\"worker\"] or [\"events:push\"]. Defaults to [\"all\"].
|
|
25
|
+
attr_accessor :capabilities
|
|
26
|
+
|
|
24
27
|
# The duration for which the token is valid.
|
|
25
28
|
attr_accessor :expires_in
|
|
26
29
|
|
|
@@ -29,6 +32,7 @@ module HatchetSdkRest
|
|
|
29
32
|
{
|
|
30
33
|
:'name' => :'name',
|
|
31
34
|
:'read_only' => :'readOnly',
|
|
35
|
+
:'capabilities' => :'capabilities',
|
|
32
36
|
:'expires_in' => :'expiresIn'
|
|
33
37
|
}
|
|
34
38
|
end
|
|
@@ -48,6 +52,7 @@ module HatchetSdkRest
|
|
|
48
52
|
{
|
|
49
53
|
:'name' => :'String',
|
|
50
54
|
:'read_only' => :'Boolean',
|
|
55
|
+
:'capabilities' => :'Array<String>',
|
|
51
56
|
:'expires_in' => :'String'
|
|
52
57
|
}
|
|
53
58
|
end
|
|
@@ -84,6 +89,12 @@ module HatchetSdkRest
|
|
|
84
89
|
self.read_only = attributes[:'read_only']
|
|
85
90
|
end
|
|
86
91
|
|
|
92
|
+
if attributes.key?(:'capabilities')
|
|
93
|
+
if (value = attributes[:'capabilities']).is_a?(Array)
|
|
94
|
+
self.capabilities = value
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
87
98
|
if attributes.key?(:'expires_in')
|
|
88
99
|
self.expires_in = attributes[:'expires_in']
|
|
89
100
|
end
|
|
@@ -102,6 +113,10 @@ module HatchetSdkRest
|
|
|
102
113
|
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
103
114
|
end
|
|
104
115
|
|
|
116
|
+
if !@capabilities.nil? && @capabilities.length < 1
|
|
117
|
+
invalid_properties.push('invalid value for "capabilities", number of items must be greater than or equal to 1.')
|
|
118
|
+
end
|
|
119
|
+
|
|
105
120
|
invalid_properties
|
|
106
121
|
end
|
|
107
122
|
|
|
@@ -111,6 +126,7 @@ module HatchetSdkRest
|
|
|
111
126
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
127
|
return false if @name.nil?
|
|
113
128
|
return false if @name.to_s.length > 255
|
|
129
|
+
return false if !@capabilities.nil? && @capabilities.length < 1
|
|
114
130
|
true
|
|
115
131
|
end
|
|
116
132
|
|
|
@@ -128,6 +144,20 @@ module HatchetSdkRest
|
|
|
128
144
|
@name = name
|
|
129
145
|
end
|
|
130
146
|
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] capabilities Value to be assigned
|
|
149
|
+
def capabilities=(capabilities)
|
|
150
|
+
if capabilities.nil?
|
|
151
|
+
fail ArgumentError, 'capabilities cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if capabilities.length < 1
|
|
155
|
+
fail ArgumentError, 'invalid value for "capabilities", number of items must be greater than or equal to 1.'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
@capabilities = capabilities
|
|
159
|
+
end
|
|
160
|
+
|
|
131
161
|
# Checks equality by comparing each attribute.
|
|
132
162
|
# @param [Object] Object to be compared
|
|
133
163
|
def ==(o)
|
|
@@ -135,6 +165,7 @@ module HatchetSdkRest
|
|
|
135
165
|
self.class == o.class &&
|
|
136
166
|
name == o.name &&
|
|
137
167
|
read_only == o.read_only &&
|
|
168
|
+
capabilities == o.capabilities &&
|
|
138
169
|
expires_in == o.expires_in
|
|
139
170
|
end
|
|
140
171
|
|
|
@@ -147,7 +178,7 @@ module HatchetSdkRest
|
|
|
147
178
|
# Calculates hash code according to all attributes.
|
|
148
179
|
# @return [Integer] Hash code
|
|
149
180
|
def hash
|
|
150
|
-
[name, read_only, expires_in].hash
|
|
181
|
+
[name, read_only, capabilities, expires_in].hash
|
|
151
182
|
end
|
|
152
183
|
|
|
153
184
|
# Builds the object from hash
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Hatchet API
|
|
3
|
+
|
|
4
|
+
#The Hatchet API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module HatchetSdkRest
|
|
17
|
+
class TenantRole
|
|
18
|
+
# The role's name, as a tenant member's role.
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# A short display name, e.g. \"Admin\".
|
|
22
|
+
attr_accessor :label
|
|
23
|
+
|
|
24
|
+
# What a member with the role can do.
|
|
25
|
+
attr_accessor :description
|
|
26
|
+
|
|
27
|
+
# The REST operations the role allows, by operation id.
|
|
28
|
+
attr_accessor :operations
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'name' => :'name',
|
|
34
|
+
:'label' => :'label',
|
|
35
|
+
:'description' => :'description',
|
|
36
|
+
:'operations' => :'operations'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'name' => :'String',
|
|
54
|
+
:'label' => :'String',
|
|
55
|
+
:'description' => :'String',
|
|
56
|
+
:'operations' => :'Array<String>'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::TenantRole` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::TenantRole`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'name')
|
|
83
|
+
self.name = attributes[:'name']
|
|
84
|
+
else
|
|
85
|
+
self.name = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'label')
|
|
89
|
+
self.label = attributes[:'label']
|
|
90
|
+
else
|
|
91
|
+
self.label = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'description')
|
|
95
|
+
self.description = attributes[:'description']
|
|
96
|
+
else
|
|
97
|
+
self.description = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'operations')
|
|
101
|
+
if (value = attributes[:'operations']).is_a?(Array)
|
|
102
|
+
self.operations = value
|
|
103
|
+
end
|
|
104
|
+
else
|
|
105
|
+
self.operations = nil
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
if @name.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @label.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "label", label cannot be nil.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if @description.nil?
|
|
123
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @operations.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "operations", operations cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
invalid_properties
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Check to see if the all the properties in the model are valid
|
|
134
|
+
# @return true if the model is valid
|
|
135
|
+
def valid?
|
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
137
|
+
return false if @name.nil?
|
|
138
|
+
return false if @label.nil?
|
|
139
|
+
return false if @description.nil?
|
|
140
|
+
return false if @operations.nil?
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method with validation
|
|
145
|
+
# @param [Object] name Value to be assigned
|
|
146
|
+
def name=(name)
|
|
147
|
+
if name.nil?
|
|
148
|
+
fail ArgumentError, 'name cannot be nil'
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
@name = name
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method with validation
|
|
155
|
+
# @param [Object] label Value to be assigned
|
|
156
|
+
def label=(label)
|
|
157
|
+
if label.nil?
|
|
158
|
+
fail ArgumentError, 'label cannot be nil'
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
@label = label
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Custom attribute writer method with validation
|
|
165
|
+
# @param [Object] description Value to be assigned
|
|
166
|
+
def description=(description)
|
|
167
|
+
if description.nil?
|
|
168
|
+
fail ArgumentError, 'description cannot be nil'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
@description = description
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Custom attribute writer method with validation
|
|
175
|
+
# @param [Object] operations Value to be assigned
|
|
176
|
+
def operations=(operations)
|
|
177
|
+
if operations.nil?
|
|
178
|
+
fail ArgumentError, 'operations cannot be nil'
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
@operations = operations
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Checks equality by comparing each attribute.
|
|
185
|
+
# @param [Object] Object to be compared
|
|
186
|
+
def ==(o)
|
|
187
|
+
return true if self.equal?(o)
|
|
188
|
+
self.class == o.class &&
|
|
189
|
+
name == o.name &&
|
|
190
|
+
label == o.label &&
|
|
191
|
+
description == o.description &&
|
|
192
|
+
operations == o.operations
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# @see the `==` method
|
|
196
|
+
# @param [Object] Object to be compared
|
|
197
|
+
def eql?(o)
|
|
198
|
+
self == o
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Calculates hash code according to all attributes.
|
|
202
|
+
# @return [Integer] Hash code
|
|
203
|
+
def hash
|
|
204
|
+
[name, label, description, operations].hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Builds the object from hash
|
|
208
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
209
|
+
# @return [Object] Returns the model itself
|
|
210
|
+
def self.build_from_hash(attributes)
|
|
211
|
+
return nil unless attributes.is_a?(Hash)
|
|
212
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
213
|
+
transformed_hash = {}
|
|
214
|
+
openapi_types.each_pair do |key, type|
|
|
215
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
216
|
+
transformed_hash["#{key}"] = nil
|
|
217
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
218
|
+
# check to ensure the input is an array given that the attribute
|
|
219
|
+
# is documented as an array but the input is not
|
|
220
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
221
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
222
|
+
end
|
|
223
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
224
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
new(transformed_hash)
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Deserializes the data based on type
|
|
231
|
+
# @param string type Data type
|
|
232
|
+
# @param string value Value to be deserialized
|
|
233
|
+
# @return [Object] Deserialized data
|
|
234
|
+
def self._deserialize(type, value)
|
|
235
|
+
case type.to_sym
|
|
236
|
+
when :Time
|
|
237
|
+
Time.parse(value)
|
|
238
|
+
when :Date
|
|
239
|
+
Date.parse(value)
|
|
240
|
+
when :String
|
|
241
|
+
value.to_s
|
|
242
|
+
when :Integer
|
|
243
|
+
value.to_i
|
|
244
|
+
when :Float
|
|
245
|
+
value.to_f
|
|
246
|
+
when :Boolean
|
|
247
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
248
|
+
true
|
|
249
|
+
else
|
|
250
|
+
false
|
|
251
|
+
end
|
|
252
|
+
when :Object
|
|
253
|
+
# generic object (usually a Hash), return directly
|
|
254
|
+
value
|
|
255
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
256
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
257
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
258
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
259
|
+
k_type = Regexp.last_match[:k_type]
|
|
260
|
+
v_type = Regexp.last_match[:v_type]
|
|
261
|
+
{}.tap do |hash|
|
|
262
|
+
value.each do |k, v|
|
|
263
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
else # model
|
|
267
|
+
# models (e.g. Pet) or oneOf
|
|
268
|
+
klass = HatchetSdkRest.const_get(type)
|
|
269
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Returns the string representation of the object
|
|
274
|
+
# @return [String] String presentation of the object
|
|
275
|
+
def to_s
|
|
276
|
+
to_hash.to_s
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
|
281
|
+
def to_body
|
|
282
|
+
to_hash
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Returns the object in the form of hash
|
|
286
|
+
# @return [Hash] Returns the object in the form of hash
|
|
287
|
+
def to_hash
|
|
288
|
+
hash = {}
|
|
289
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
290
|
+
value = self.send(attr)
|
|
291
|
+
if value.nil?
|
|
292
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
293
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
hash[param] = _to_hash(value)
|
|
297
|
+
end
|
|
298
|
+
hash
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Outputs non-array value in the form of hash
|
|
302
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
303
|
+
# @param [Object] value Any valid value
|
|
304
|
+
# @return [Hash] Returns the value in the form of hash
|
|
305
|
+
def _to_hash(value)
|
|
306
|
+
if value.is_a?(Array)
|
|
307
|
+
value.compact.map { |v| _to_hash(v) }
|
|
308
|
+
elsif value.is_a?(Hash)
|
|
309
|
+
{}.tap do |hash|
|
|
310
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
311
|
+
end
|
|
312
|
+
elsif value.respond_to? :to_hash
|
|
313
|
+
value.to_hash
|
|
314
|
+
else
|
|
315
|
+
value
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
end
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Hatchet API
|
|
3
|
+
|
|
4
|
+
#The Hatchet API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module HatchetSdkRest
|
|
17
|
+
class TenantRoleList
|
|
18
|
+
attr_accessor :rows
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'rows' => :'rows'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'rows' => :'Array<TenantRole>'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::TenantRoleList` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::TenantRoleList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'rows')
|
|
67
|
+
if (value = attributes[:'rows']).is_a?(Array)
|
|
68
|
+
self.rows = value
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
self.rows = nil
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
if @rows.nil?
|
|
81
|
+
invalid_properties.push('invalid value for "rows", rows cannot be nil.')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
return false if @rows.nil?
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Custom attribute writer method with validation
|
|
96
|
+
# @param [Object] rows Value to be assigned
|
|
97
|
+
def rows=(rows)
|
|
98
|
+
if rows.nil?
|
|
99
|
+
fail ArgumentError, 'rows cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
@rows = rows
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Checks equality by comparing each attribute.
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def ==(o)
|
|
108
|
+
return true if self.equal?(o)
|
|
109
|
+
self.class == o.class &&
|
|
110
|
+
rows == o.rows
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[rows].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
transformed_hash = {}
|
|
132
|
+
openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = nil
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
new(transformed_hash)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Deserializes the data based on type
|
|
149
|
+
# @param string type Data type
|
|
150
|
+
# @param string value Value to be deserialized
|
|
151
|
+
# @return [Object] Deserialized data
|
|
152
|
+
def self._deserialize(type, value)
|
|
153
|
+
case type.to_sym
|
|
154
|
+
when :Time
|
|
155
|
+
Time.parse(value)
|
|
156
|
+
when :Date
|
|
157
|
+
Date.parse(value)
|
|
158
|
+
when :String
|
|
159
|
+
value.to_s
|
|
160
|
+
when :Integer
|
|
161
|
+
value.to_i
|
|
162
|
+
when :Float
|
|
163
|
+
value.to_f
|
|
164
|
+
when :Boolean
|
|
165
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
166
|
+
true
|
|
167
|
+
else
|
|
168
|
+
false
|
|
169
|
+
end
|
|
170
|
+
when :Object
|
|
171
|
+
# generic object (usually a Hash), return directly
|
|
172
|
+
value
|
|
173
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
174
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
175
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
176
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
177
|
+
k_type = Regexp.last_match[:k_type]
|
|
178
|
+
v_type = Regexp.last_match[:v_type]
|
|
179
|
+
{}.tap do |hash|
|
|
180
|
+
value.each do |k, v|
|
|
181
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
else # model
|
|
185
|
+
# models (e.g. Pet) or oneOf
|
|
186
|
+
klass = HatchetSdkRest.const_get(type)
|
|
187
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Returns the string representation of the object
|
|
192
|
+
# @return [String] String presentation of the object
|
|
193
|
+
def to_s
|
|
194
|
+
to_hash.to_s
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
|
199
|
+
def to_body
|
|
200
|
+
to_hash
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Returns the object in the form of hash
|
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
|
205
|
+
def to_hash
|
|
206
|
+
hash = {}
|
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
208
|
+
value = self.send(attr)
|
|
209
|
+
if value.nil?
|
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
hash[param] = _to_hash(value)
|
|
215
|
+
end
|
|
216
|
+
hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Outputs non-array value in the form of hash
|
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
221
|
+
# @param [Object] value Any valid value
|
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
|
223
|
+
def _to_hash(value)
|
|
224
|
+
if value.is_a?(Array)
|
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
|
226
|
+
elsif value.is_a?(Hash)
|
|
227
|
+
{}.tap do |hash|
|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
229
|
+
end
|
|
230
|
+
elsif value.respond_to? :to_hash
|
|
231
|
+
value.to_hash
|
|
232
|
+
else
|
|
233
|
+
value
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|