eilam_test 1.1.12 → 1.1.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,289 @@
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
+ # Event object represents storage system alerts and messages.
18
+ class Event
19
+ # description
20
+ attr_accessor :description
21
+
22
+ # error_code
23
+ attr_accessor :error_code
24
+
25
+ # event_id
26
+ attr_accessor :event_id
27
+
28
+ # event_type
29
+ attr_accessor :event_type
30
+
31
+ # fixed
32
+ attr_accessor :fixed
33
+
34
+ # last_timestamp
35
+ attr_accessor :last_timestamp
36
+
37
+ attr_accessor :storage_system
38
+
39
+ # uuid
40
+ attr_accessor :uuid
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'description' => :'description',
46
+ :'error_code' => :'error_code',
47
+ :'event_id' => :'event_id',
48
+ :'event_type' => :'event_type',
49
+ :'fixed' => :'fixed',
50
+ :'last_timestamp' => :'last_timestamp',
51
+ :'storage_system' => :'storage_system',
52
+ :'uuid' => :'uuid'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'description' => :'String',
65
+ :'error_code' => :'String',
66
+ :'event_id' => :'Integer',
67
+ :'event_type' => :'String',
68
+ :'fixed' => :'String',
69
+ :'last_timestamp' => :'Time',
70
+ :'storage_system' => :'StorageSystem',
71
+ :'uuid' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EilamTest::Event` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EilamTest::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'description')
97
+ self.description = attributes[:'description']
98
+ end
99
+
100
+ if attributes.key?(:'error_code')
101
+ self.error_code = attributes[:'error_code']
102
+ end
103
+
104
+ if attributes.key?(:'event_id')
105
+ self.event_id = attributes[:'event_id']
106
+ end
107
+
108
+ if attributes.key?(:'event_type')
109
+ self.event_type = attributes[:'event_type']
110
+ end
111
+
112
+ if attributes.key?(:'fixed')
113
+ self.fixed = attributes[:'fixed']
114
+ end
115
+
116
+ if attributes.key?(:'last_timestamp')
117
+ self.last_timestamp = attributes[:'last_timestamp']
118
+ end
119
+
120
+ if attributes.key?(:'storage_system')
121
+ self.storage_system = attributes[:'storage_system']
122
+ end
123
+
124
+ if attributes.key?(:'uuid')
125
+ self.uuid = attributes[:'uuid']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ description == o.description &&
148
+ error_code == o.error_code &&
149
+ event_id == o.event_id &&
150
+ event_type == o.event_type &&
151
+ fixed == o.fixed &&
152
+ last_timestamp == o.last_timestamp &&
153
+ storage_system == o.storage_system &&
154
+ uuid == o.uuid
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [description, error_code, event_id, event_type, fixed, last_timestamp, storage_system, uuid].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ new.build_from_hash(attributes)
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.openapi_types.each_pair do |key, type|
182
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
183
+ self.send("#{key}=", nil)
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :Time
205
+ Time.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ # models (e.g. Pet) or oneOf
236
+ klass = EilamTest.const_get(type)
237
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end
@@ -108,7 +108,7 @@ module EilamTest
108
108
  if attributes.key?(:'name')
109
109
  self.name = attributes[:'name']
110
110
  else
111
- self.name = 'FlashSystems/SVC'
111
+ self.name = 'IBM_FlashSystems'
112
112
  end
113
113
 
114
114
  if attributes.key?(:'short_version')
@@ -149,7 +149,7 @@ module EilamTest
149
149
  component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
150
150
  return false unless component_state_validator.valid?(@component_state)
151
151
  return false if !@component_state.nil? && @component_state.to_s.length > 32
152
- name_validator = EnumAttributeValidator.new('String', ["a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00", "FlashSystems/SVC"])
152
+ name_validator = EnumAttributeValidator.new('String', ["IBM_FlashSystems", "a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00"])
153
153
  return false unless name_validator.valid?(@name)
154
154
  return false if !@name.nil? && @name.to_s.length > 255
155
155
  return false if !@short_version.nil? && @short_version.to_s.length > 255
@@ -169,7 +169,7 @@ module EilamTest
169
169
  # Custom attribute writer method checking allowed values (enum).
170
170
  # @param [Object] name Object to be assigned
171
171
  def name=(name)
172
- validator = EnumAttributeValidator.new('String', ["a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00", "FlashSystems/SVC"])
172
+ validator = EnumAttributeValidator.new('String', ["IBM_FlashSystems", "a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00"])
173
173
  unless validator.valid?(name)
174
174
  fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
175
175
  end
@@ -113,7 +113,7 @@ module EilamTest
113
113
  if attributes.key?(:'name')
114
114
  self.name = attributes[:'name']
115
115
  else
116
- self.name = 'FlashSystems/SVC'
116
+ self.name = 'IBM_FlashSystems'
117
117
  end
118
118
 
119
119
  if attributes.key?(:'short_version')
@@ -160,7 +160,7 @@ module EilamTest
160
160
  component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
161
161
  return false unless component_state_validator.valid?(@component_state)
162
162
  return false if !@component_state.nil? && @component_state.to_s.length > 32
163
- name_validator = EnumAttributeValidator.new('String', ["a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00", "FlashSystems/SVC"])
163
+ name_validator = EnumAttributeValidator.new('String', ["IBM_FlashSystems", "a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00"])
164
164
  return false unless name_validator.valid?(@name)
165
165
  return false if !@name.nil? && @name.to_s.length > 255
166
166
  return false if !@short_version.nil? && @short_version.to_s.length > 255
@@ -180,7 +180,7 @@ module EilamTest
180
180
  # Custom attribute writer method checking allowed values (enum).
181
181
  # @param [Object] name Object to be assigned
182
182
  def name=(name)
183
- validator = EnumAttributeValidator.new('String', ["a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00", "FlashSystems/SVC"])
183
+ validator = EnumAttributeValidator.new('String', ["IBM_FlashSystems", "a_line", "xiv", "ds8000", "vmax", "netapp", "ds8x00"])
184
184
  unless validator.valid?(name)
185
185
  fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
186
186
  end