eilam_test 10 → 11.1
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/README.md +8 -0
- data/docs/CeleryConfig.md +20 -0
- data/docs/CeleryConfigApi.md +140 -0
- data/docs/Event.md +4 -0
- data/docs/EventApi.md +16 -16
- data/docs/EventResponse.md +36 -0
- data/docs/Job.md +2 -0
- data/docs/JobApi.md +136 -0
- data/docs/JobCreate.md +2 -2
- data/docs/RefreshSystem.md +18 -0
- data/docs/RefreshSystemApi.md +75 -0
- data/docs/StorageSystemCreate.md +2 -0
- data/lib/eilam_test/api/celery_config_api.rb +136 -0
- data/lib/eilam_test/api/event_api.rb +12 -12
- data/lib/eilam_test/api/job_api.rb +118 -0
- data/lib/eilam_test/api/refresh_system_api.rb +83 -0
- data/lib/eilam_test/models/celery_config.rb +230 -0
- data/lib/eilam_test/models/event.rb +22 -2
- data/lib/eilam_test/models/event_response.rb +310 -0
- data/lib/eilam_test/models/job.rb +11 -1
- data/lib/eilam_test/models/job_create.rb +8 -8
- data/lib/eilam_test/models/refresh_system.rb +220 -0
- data/lib/eilam_test/models/storage_system_create.rb +13 -1
- data/lib/eilam_test/version.rb +2 -2
- data/lib/eilam_test.rb +5 -0
- data/spec/api/celery_config_api_spec.rb +54 -0
- data/spec/api/event_api_spec.rb +4 -4
- data/spec/api/job_api_spec.rb +20 -0
- data/spec/api/refresh_system_api_spec.rb +45 -0
- data/spec/models/celery_config_spec.rb +40 -0
- data/spec/models/event_response_spec.rb +88 -0
- data/spec/models/event_spec.rb +12 -0
- data/spec/models/job_create_spec.rb +1 -1
- data/spec/models/job_spec.rb +6 -0
- data/spec/models/refresh_system_spec.rb +34 -0
- data/spec/models/storage_system_create_spec.rb +6 -0
- metadata +94 -74
@@ -0,0 +1,230 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module EilamTest
|
17
|
+
# CeleryBeatConfig object represents celery-beat (refresh params
|
18
|
+
class CeleryConfig
|
19
|
+
# celery_beat_enabled
|
20
|
+
attr_accessor :celery_beat_enabled
|
21
|
+
|
22
|
+
# interval_sec
|
23
|
+
attr_accessor :interval_sec
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'celery_beat_enabled' => :'celery_beat_enabled',
|
29
|
+
:'interval_sec' => :'interval_sec'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'celery_beat_enabled' => :'Boolean',
|
42
|
+
:'interval_sec' => :'Integer'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
if (!attributes.is_a?(Hash))
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `EilamTest::CeleryConfig` initialize method"
|
57
|
+
end
|
58
|
+
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `EilamTest::CeleryConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
h[k.to_sym] = v
|
65
|
+
}
|
66
|
+
|
67
|
+
if attributes.key?(:'celery_beat_enabled')
|
68
|
+
self.celery_beat_enabled = attributes[:'celery_beat_enabled']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'interval_sec')
|
72
|
+
self.interval_sec = attributes[:'interval_sec']
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
77
|
+
# @return Array for valid properties with the reasons
|
78
|
+
def list_invalid_properties
|
79
|
+
invalid_properties = Array.new
|
80
|
+
invalid_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
# Check to see if the all the properties in the model are valid
|
84
|
+
# @return true if the model is valid
|
85
|
+
def valid?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
celery_beat_enabled == o.celery_beat_enabled &&
|
95
|
+
interval_sec == o.interval_sec
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[celery_beat_enabled, interval_sec].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
123
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
124
|
+
self.send("#{key}=", nil)
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
126
|
+
# check to ensure the input is an array given that the attribute
|
127
|
+
# is documented as an array but the input is not
|
128
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
129
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
130
|
+
end
|
131
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
132
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
self
|
137
|
+
end
|
138
|
+
|
139
|
+
# Deserializes the data based on type
|
140
|
+
# @param string type Data type
|
141
|
+
# @param string value Value to be deserialized
|
142
|
+
# @return [Object] Deserialized data
|
143
|
+
def _deserialize(type, value)
|
144
|
+
case type.to_sym
|
145
|
+
when :Time
|
146
|
+
Time.parse(value)
|
147
|
+
when :Date
|
148
|
+
Date.parse(value)
|
149
|
+
when :String
|
150
|
+
value.to_s
|
151
|
+
when :Integer
|
152
|
+
value.to_i
|
153
|
+
when :Float
|
154
|
+
value.to_f
|
155
|
+
when :Boolean
|
156
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
157
|
+
true
|
158
|
+
else
|
159
|
+
false
|
160
|
+
end
|
161
|
+
when :Object
|
162
|
+
# generic object (usually a Hash), return directly
|
163
|
+
value
|
164
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
165
|
+
inner_type = Regexp.last_match[:inner_type]
|
166
|
+
value.map { |v| _deserialize(inner_type, v) }
|
167
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
168
|
+
k_type = Regexp.last_match[:k_type]
|
169
|
+
v_type = Regexp.last_match[:v_type]
|
170
|
+
{}.tap do |hash|
|
171
|
+
value.each do |k, v|
|
172
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
else # model
|
176
|
+
# models (e.g. Pet) or oneOf
|
177
|
+
klass = EilamTest.const_get(type)
|
178
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the string representation of the object
|
183
|
+
# @return [String] String presentation of the object
|
184
|
+
def to_s
|
185
|
+
to_hash.to_s
|
186
|
+
end
|
187
|
+
|
188
|
+
# to_body is an alias to to_hash (backward compatibility)
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_body
|
191
|
+
to_hash
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns the object in the form of hash
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_hash
|
197
|
+
hash = {}
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
199
|
+
value = self.send(attr)
|
200
|
+
if value.nil?
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
203
|
+
end
|
204
|
+
|
205
|
+
hash[param] = _to_hash(value)
|
206
|
+
end
|
207
|
+
hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Outputs non-array value in the form of hash
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
212
|
+
# @param [Object] value Any valid value
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
@@ -14,8 +14,11 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module EilamTest
|
17
|
-
# Event
|
17
|
+
# Event
|
18
18
|
class Event
|
19
|
+
# created_at
|
20
|
+
attr_accessor :created_at
|
21
|
+
|
19
22
|
# description
|
20
23
|
attr_accessor :description
|
21
24
|
|
@@ -34,6 +37,9 @@ module EilamTest
|
|
34
37
|
# last_timestamp
|
35
38
|
attr_accessor :last_timestamp
|
36
39
|
|
40
|
+
# refresh_interval
|
41
|
+
attr_accessor :refresh_interval
|
42
|
+
|
37
43
|
attr_accessor :storage_system
|
38
44
|
|
39
45
|
# uuid
|
@@ -42,12 +48,14 @@ module EilamTest
|
|
42
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
49
|
def self.attribute_map
|
44
50
|
{
|
51
|
+
:'created_at' => :'created_at',
|
45
52
|
:'description' => :'description',
|
46
53
|
:'error_code' => :'error_code',
|
47
54
|
:'event_id' => :'event_id',
|
48
55
|
:'event_type' => :'event_type',
|
49
56
|
:'fixed' => :'fixed',
|
50
57
|
:'last_timestamp' => :'last_timestamp',
|
58
|
+
:'refresh_interval' => :'refresh_interval',
|
51
59
|
:'storage_system' => :'storage_system',
|
52
60
|
:'uuid' => :'uuid'
|
53
61
|
}
|
@@ -61,12 +69,14 @@ module EilamTest
|
|
61
69
|
# Attribute type mapping.
|
62
70
|
def self.openapi_types
|
63
71
|
{
|
72
|
+
:'created_at' => :'Time',
|
64
73
|
:'description' => :'String',
|
65
74
|
:'error_code' => :'String',
|
66
75
|
:'event_id' => :'Integer',
|
67
76
|
:'event_type' => :'String',
|
68
77
|
:'fixed' => :'String',
|
69
78
|
:'last_timestamp' => :'Time',
|
79
|
+
:'refresh_interval' => :'Integer',
|
70
80
|
:'storage_system' => :'StorageSystem',
|
71
81
|
:'uuid' => :'String'
|
72
82
|
}
|
@@ -93,6 +103,10 @@ module EilamTest
|
|
93
103
|
h[k.to_sym] = v
|
94
104
|
}
|
95
105
|
|
106
|
+
if attributes.key?(:'created_at')
|
107
|
+
self.created_at = attributes[:'created_at']
|
108
|
+
end
|
109
|
+
|
96
110
|
if attributes.key?(:'description')
|
97
111
|
self.description = attributes[:'description']
|
98
112
|
end
|
@@ -117,6 +131,10 @@ module EilamTest
|
|
117
131
|
self.last_timestamp = attributes[:'last_timestamp']
|
118
132
|
end
|
119
133
|
|
134
|
+
if attributes.key?(:'refresh_interval')
|
135
|
+
self.refresh_interval = attributes[:'refresh_interval']
|
136
|
+
end
|
137
|
+
|
120
138
|
if attributes.key?(:'storage_system')
|
121
139
|
self.storage_system = attributes[:'storage_system']
|
122
140
|
end
|
@@ -144,12 +162,14 @@ module EilamTest
|
|
144
162
|
def ==(o)
|
145
163
|
return true if self.equal?(o)
|
146
164
|
self.class == o.class &&
|
165
|
+
created_at == o.created_at &&
|
147
166
|
description == o.description &&
|
148
167
|
error_code == o.error_code &&
|
149
168
|
event_id == o.event_id &&
|
150
169
|
event_type == o.event_type &&
|
151
170
|
fixed == o.fixed &&
|
152
171
|
last_timestamp == o.last_timestamp &&
|
172
|
+
refresh_interval == o.refresh_interval &&
|
153
173
|
storage_system == o.storage_system &&
|
154
174
|
uuid == o.uuid
|
155
175
|
end
|
@@ -163,7 +183,7 @@ module EilamTest
|
|
163
183
|
# Calculates hash code according to all attributes.
|
164
184
|
# @return [Integer] Hash code
|
165
185
|
def hash
|
166
|
-
[description, error_code, event_id, event_type, fixed, last_timestamp, storage_system, uuid].hash
|
186
|
+
[created_at, description, error_code, event_id, event_type, fixed, last_timestamp, refresh_interval, storage_system, uuid].hash
|
167
187
|
end
|
168
188
|
|
169
189
|
# Builds the object from hash
|
@@ -0,0 +1,310 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module EilamTest
|
17
|
+
# TODO add description
|
18
|
+
class EventResponse
|
19
|
+
# created_at
|
20
|
+
attr_accessor :created_at
|
21
|
+
|
22
|
+
# description
|
23
|
+
attr_accessor :description
|
24
|
+
|
25
|
+
# error_code
|
26
|
+
attr_accessor :error_code
|
27
|
+
|
28
|
+
# event_id
|
29
|
+
attr_accessor :event_id
|
30
|
+
|
31
|
+
# event_type
|
32
|
+
attr_accessor :event_type
|
33
|
+
|
34
|
+
# fixed
|
35
|
+
attr_accessor :fixed
|
36
|
+
|
37
|
+
# last_timestamp
|
38
|
+
attr_accessor :last_timestamp
|
39
|
+
|
40
|
+
# refresh_interval
|
41
|
+
attr_accessor :refresh_interval
|
42
|
+
|
43
|
+
# !!uuid of storage_system
|
44
|
+
attr_accessor :storage_system
|
45
|
+
|
46
|
+
# uuid
|
47
|
+
attr_accessor :uuid
|
48
|
+
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
50
|
+
def self.attribute_map
|
51
|
+
{
|
52
|
+
:'created_at' => :'created_at',
|
53
|
+
:'description' => :'description',
|
54
|
+
:'error_code' => :'error_code',
|
55
|
+
:'event_id' => :'event_id',
|
56
|
+
:'event_type' => :'event_type',
|
57
|
+
:'fixed' => :'fixed',
|
58
|
+
:'last_timestamp' => :'last_timestamp',
|
59
|
+
:'refresh_interval' => :'refresh_interval',
|
60
|
+
:'storage_system' => :'storage_system',
|
61
|
+
:'uuid' => :'uuid'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Returns all the JSON keys this model knows about
|
66
|
+
def self.acceptable_attributes
|
67
|
+
attribute_map.values
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'created_at' => :'Time',
|
74
|
+
:'description' => :'String',
|
75
|
+
:'error_code' => :'String',
|
76
|
+
:'event_id' => :'Integer',
|
77
|
+
:'event_type' => :'String',
|
78
|
+
:'fixed' => :'String',
|
79
|
+
:'last_timestamp' => :'Time',
|
80
|
+
:'refresh_interval' => :'Integer',
|
81
|
+
:'storage_system' => :'String',
|
82
|
+
:'uuid' => :'String'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# List of attributes with nullable: true
|
87
|
+
def self.openapi_nullable
|
88
|
+
Set.new([
|
89
|
+
])
|
90
|
+
end
|
91
|
+
|
92
|
+
# Initializes the object
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
94
|
+
def initialize(attributes = {})
|
95
|
+
if (!attributes.is_a?(Hash))
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `EilamTest::EventResponse` initialize method"
|
97
|
+
end
|
98
|
+
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
101
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
102
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `EilamTest::EventResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
103
|
+
end
|
104
|
+
h[k.to_sym] = v
|
105
|
+
}
|
106
|
+
|
107
|
+
if attributes.key?(:'created_at')
|
108
|
+
self.created_at = attributes[:'created_at']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'description')
|
112
|
+
self.description = attributes[:'description']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'error_code')
|
116
|
+
self.error_code = attributes[:'error_code']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'event_id')
|
120
|
+
self.event_id = attributes[:'event_id']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'event_type')
|
124
|
+
self.event_type = attributes[:'event_type']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'fixed')
|
128
|
+
self.fixed = attributes[:'fixed']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'last_timestamp')
|
132
|
+
self.last_timestamp = attributes[:'last_timestamp']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'refresh_interval')
|
136
|
+
self.refresh_interval = attributes[:'refresh_interval']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'storage_system')
|
140
|
+
self.storage_system = attributes[:'storage_system']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'uuid')
|
144
|
+
self.uuid = attributes[:'uuid']
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
149
|
+
# @return Array for valid properties with the reasons
|
150
|
+
def list_invalid_properties
|
151
|
+
invalid_properties = Array.new
|
152
|
+
invalid_properties
|
153
|
+
end
|
154
|
+
|
155
|
+
# Check to see if the all the properties in the model are valid
|
156
|
+
# @return true if the model is valid
|
157
|
+
def valid?
|
158
|
+
true
|
159
|
+
end
|
160
|
+
|
161
|
+
# Checks equality by comparing each attribute.
|
162
|
+
# @param [Object] Object to be compared
|
163
|
+
def ==(o)
|
164
|
+
return true if self.equal?(o)
|
165
|
+
self.class == o.class &&
|
166
|
+
created_at == o.created_at &&
|
167
|
+
description == o.description &&
|
168
|
+
error_code == o.error_code &&
|
169
|
+
event_id == o.event_id &&
|
170
|
+
event_type == o.event_type &&
|
171
|
+
fixed == o.fixed &&
|
172
|
+
last_timestamp == o.last_timestamp &&
|
173
|
+
refresh_interval == o.refresh_interval &&
|
174
|
+
storage_system == o.storage_system &&
|
175
|
+
uuid == o.uuid
|
176
|
+
end
|
177
|
+
|
178
|
+
# @see the `==` method
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def eql?(o)
|
181
|
+
self == o
|
182
|
+
end
|
183
|
+
|
184
|
+
# Calculates hash code according to all attributes.
|
185
|
+
# @return [Integer] Hash code
|
186
|
+
def hash
|
187
|
+
[created_at, description, error_code, event_id, event_type, fixed, last_timestamp, refresh_interval, storage_system, uuid].hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Builds the object from hash
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
+
# @return [Object] Returns the model itself
|
193
|
+
def self.build_from_hash(attributes)
|
194
|
+
new.build_from_hash(attributes)
|
195
|
+
end
|
196
|
+
|
197
|
+
# Builds the object from hash
|
198
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
+
# @return [Object] Returns the model itself
|
200
|
+
def build_from_hash(attributes)
|
201
|
+
return nil unless attributes.is_a?(Hash)
|
202
|
+
self.class.openapi_types.each_pair do |key, type|
|
203
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
204
|
+
self.send("#{key}=", nil)
|
205
|
+
elsif type =~ /\AArray<(.*)>/i
|
206
|
+
# check to ensure the input is an array given that the attribute
|
207
|
+
# is documented as an array but the input is not
|
208
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
209
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
210
|
+
end
|
211
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
212
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
self
|
217
|
+
end
|
218
|
+
|
219
|
+
# Deserializes the data based on type
|
220
|
+
# @param string type Data type
|
221
|
+
# @param string value Value to be deserialized
|
222
|
+
# @return [Object] Deserialized data
|
223
|
+
def _deserialize(type, value)
|
224
|
+
case type.to_sym
|
225
|
+
when :Time
|
226
|
+
Time.parse(value)
|
227
|
+
when :Date
|
228
|
+
Date.parse(value)
|
229
|
+
when :String
|
230
|
+
value.to_s
|
231
|
+
when :Integer
|
232
|
+
value.to_i
|
233
|
+
when :Float
|
234
|
+
value.to_f
|
235
|
+
when :Boolean
|
236
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
237
|
+
true
|
238
|
+
else
|
239
|
+
false
|
240
|
+
end
|
241
|
+
when :Object
|
242
|
+
# generic object (usually a Hash), return directly
|
243
|
+
value
|
244
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
245
|
+
inner_type = Regexp.last_match[:inner_type]
|
246
|
+
value.map { |v| _deserialize(inner_type, v) }
|
247
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
248
|
+
k_type = Regexp.last_match[:k_type]
|
249
|
+
v_type = Regexp.last_match[:v_type]
|
250
|
+
{}.tap do |hash|
|
251
|
+
value.each do |k, v|
|
252
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
else # model
|
256
|
+
# models (e.g. Pet) or oneOf
|
257
|
+
klass = EilamTest.const_get(type)
|
258
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# Returns the string representation of the object
|
263
|
+
# @return [String] String presentation of the object
|
264
|
+
def to_s
|
265
|
+
to_hash.to_s
|
266
|
+
end
|
267
|
+
|
268
|
+
# to_body is an alias to to_hash (backward compatibility)
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
270
|
+
def to_body
|
271
|
+
to_hash
|
272
|
+
end
|
273
|
+
|
274
|
+
# Returns the object in the form of hash
|
275
|
+
# @return [Hash] Returns the object in the form of hash
|
276
|
+
def to_hash
|
277
|
+
hash = {}
|
278
|
+
self.class.attribute_map.each_pair do |attr, param|
|
279
|
+
value = self.send(attr)
|
280
|
+
if value.nil?
|
281
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
282
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
283
|
+
end
|
284
|
+
|
285
|
+
hash[param] = _to_hash(value)
|
286
|
+
end
|
287
|
+
hash
|
288
|
+
end
|
289
|
+
|
290
|
+
# Outputs non-array value in the form of hash
|
291
|
+
# For object, use to_hash. Otherwise, just return the value
|
292
|
+
# @param [Object] value Any valid value
|
293
|
+
# @return [Hash] Returns the value in the form of hash
|
294
|
+
def _to_hash(value)
|
295
|
+
if value.is_a?(Array)
|
296
|
+
value.compact.map { |v| _to_hash(v) }
|
297
|
+
elsif value.is_a?(Hash)
|
298
|
+
{}.tap do |hash|
|
299
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
300
|
+
end
|
301
|
+
elsif value.respond_to? :to_hash
|
302
|
+
value.to_hash
|
303
|
+
else
|
304
|
+
value
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
end
|
309
|
+
|
310
|
+
end
|
@@ -22,6 +22,9 @@ module EilamTest
|
|
22
22
|
# date_started
|
23
23
|
attr_accessor :date_started
|
24
24
|
|
25
|
+
# extra
|
26
|
+
attr_accessor :extra
|
27
|
+
|
25
28
|
# status
|
26
29
|
attr_accessor :status
|
27
30
|
|
@@ -42,6 +45,7 @@ module EilamTest
|
|
42
45
|
{
|
43
46
|
:'date_finished' => :'date_finished',
|
44
47
|
:'date_started' => :'date_started',
|
48
|
+
:'extra' => :'extra',
|
45
49
|
:'status' => :'status',
|
46
50
|
:'task_args' => :'task_args',
|
47
51
|
:'task_id' => :'task_id',
|
@@ -60,6 +64,7 @@ module EilamTest
|
|
60
64
|
{
|
61
65
|
:'date_finished' => :'Time',
|
62
66
|
:'date_started' => :'Time',
|
67
|
+
:'extra' => :'String',
|
63
68
|
:'status' => :'String',
|
64
69
|
:'task_args' => :'String',
|
65
70
|
:'task_id' => :'String',
|
@@ -97,6 +102,10 @@ module EilamTest
|
|
97
102
|
self.date_started = attributes[:'date_started']
|
98
103
|
end
|
99
104
|
|
105
|
+
if attributes.key?(:'extra')
|
106
|
+
self.extra = attributes[:'extra']
|
107
|
+
end
|
108
|
+
|
100
109
|
if attributes.key?(:'status')
|
101
110
|
self.status = attributes[:'status']
|
102
111
|
end
|
@@ -138,6 +147,7 @@ module EilamTest
|
|
138
147
|
self.class == o.class &&
|
139
148
|
date_finished == o.date_finished &&
|
140
149
|
date_started == o.date_started &&
|
150
|
+
extra == o.extra &&
|
141
151
|
status == o.status &&
|
142
152
|
task_args == o.task_args &&
|
143
153
|
task_id == o.task_id &&
|
@@ -154,7 +164,7 @@ module EilamTest
|
|
154
164
|
# Calculates hash code according to all attributes.
|
155
165
|
# @return [Integer] Hash code
|
156
166
|
def hash
|
157
|
-
[date_finished, date_started, status, task_args, task_id, task_kwargs, task_name].hash
|
167
|
+
[date_finished, date_started, extra, status, task_args, task_id, task_kwargs, task_name].hash
|
158
168
|
end
|
159
169
|
|
160
170
|
# Builds the object from hash
|