xbim_comms 2.0.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. metadata +7 -149
  3. data/Gemfile +0 -9
  4. data/README.md +0 -210
  5. data/Rakefile +0 -10
  6. data/lib/xbim_comms/api/contacts_api.rb +0 -206
  7. data/lib/xbim_comms/api/conversations_api.rb +0 -2670
  8. data/lib/xbim_comms/api/files_api.rb +0 -107
  9. data/lib/xbim_comms/api/snapshots_api.rb +0 -100
  10. data/lib/xbim_comms/api_client.rb +0 -390
  11. data/lib/xbim_comms/api_error.rb +0 -57
  12. data/lib/xbim_comms/configuration.rb +0 -278
  13. data/lib/xbim_comms/models/aggregate.rb +0 -227
  14. data/lib/xbim_comms/models/aggregate_list_value.rb +0 -220
  15. data/lib/xbim_comms/models/analytical_result.rb +0 -270
  16. data/lib/xbim_comms/models/analytical_result_all_of.rb +0 -258
  17. data/lib/xbim_comms/models/animation.rb +0 -232
  18. data/lib/xbim_comms/models/animation_all_of.rb +0 -220
  19. data/lib/xbim_comms/models/bitmap.rb +0 -303
  20. data/lib/xbim_comms/models/blob.rb +0 -245
  21. data/lib/xbim_comms/models/boolean_value.rb +0 -218
  22. data/lib/xbim_comms/models/clipping_plane.rb +0 -231
  23. data/lib/xbim_comms/models/coloring.rb +0 -229
  24. data/lib/xbim_comms/models/column_request.rb +0 -279
  25. data/lib/xbim_comms/models/component.rb +0 -236
  26. data/lib/xbim_comms/models/components.rb +0 -240
  27. data/lib/xbim_comms/models/contact.rb +0 -227
  28. data/lib/xbim_comms/models/contact_list.rb +0 -238
  29. data/lib/xbim_comms/models/conversation.rb +0 -392
  30. data/lib/xbim_comms/models/conversation_create.rb +0 -273
  31. data/lib/xbim_comms/models/conversation_list.rb +0 -238
  32. data/lib/xbim_comms/models/conversation_tenant.rb +0 -254
  33. data/lib/xbim_comms/models/conversation_update.rb +0 -302
  34. data/lib/xbim_comms/models/entity_key.rb +0 -227
  35. data/lib/xbim_comms/models/exception_message.rb +0 -245
  36. data/lib/xbim_comms/models/file.rb +0 -266
  37. data/lib/xbim_comms/models/file_all_of.rb +0 -254
  38. data/lib/xbim_comms/models/int32_value.rb +0 -218
  39. data/lib/xbim_comms/models/key_frame.rb +0 -236
  40. data/lib/xbim_comms/models/line.rb +0 -231
  41. data/lib/xbim_comms/models/message.rb +0 -416
  42. data/lib/xbim_comms/models/message_content.rb +0 -220
  43. data/lib/xbim_comms/models/message_create.rb +0 -273
  44. data/lib/xbim_comms/models/message_list.rb +0 -238
  45. data/lib/xbim_comms/models/message_part.rb +0 -246
  46. data/lib/xbim_comms/models/message_update.rb +0 -297
  47. data/lib/xbim_comms/models/orthogonal_camera.rb +0 -269
  48. data/lib/xbim_comms/models/participant.rb +0 -232
  49. data/lib/xbim_comms/models/participant_with_role.rb +0 -293
  50. data/lib/xbim_comms/models/participant_with_role_create.rb +0 -266
  51. data/lib/xbim_comms/models/participant_with_role_list.rb +0 -238
  52. data/lib/xbim_comms/models/participant_with_role_update.rb +0 -261
  53. data/lib/xbim_comms/models/perspective_camera.rb +0 -269
  54. data/lib/xbim_comms/models/pie_chart.rb +0 -257
  55. data/lib/xbim_comms/models/pie_chart_all_of.rb +0 -245
  56. data/lib/xbim_comms/models/point.rb +0 -227
  57. data/lib/xbim_comms/models/preview_row.rb +0 -220
  58. data/lib/xbim_comms/models/schedule.rb +0 -270
  59. data/lib/xbim_comms/models/schedule_all_of.rb +0 -258
  60. data/lib/xbim_comms/models/schedule_column.rb +0 -384
  61. data/lib/xbim_comms/models/schedule_request.rb +0 -252
  62. data/lib/xbim_comms/models/schedule_request_all_of.rb +0 -240
  63. data/lib/xbim_comms/models/section_box.rb +0 -274
  64. data/lib/xbim_comms/models/sheet.rb +0 -268
  65. data/lib/xbim_comms/models/sheet_all_of.rb +0 -256
  66. data/lib/xbim_comms/models/sheet_part.rb +0 -254
  67. data/lib/xbim_comms/models/snapshot.rb +0 -270
  68. data/lib/xbim_comms/models/text.rb +0 -220
  69. data/lib/xbim_comms/models/view.rb +0 -239
  70. data/lib/xbim_comms/models/view_all_of.rb +0 -227
  71. data/lib/xbim_comms/models/view_setup_hints.rb +0 -236
  72. data/lib/xbim_comms/models/viewpoint.rb +0 -296
  73. data/lib/xbim_comms/models/visibility.rb +0 -238
  74. data/lib/xbim_comms/version.rb +0 -15
  75. data/lib/xbim_comms.rb +0 -104
  76. data/spec/api/contacts_api_spec.rb +0 -74
  77. data/spec/api/conversations_api_spec.rb +0 -521
  78. data/spec/api/files_api_spec.rb +0 -50
  79. data/spec/api/snapshots_api_spec.rb +0 -49
  80. data/spec/api_client_spec.rb +0 -226
  81. data/spec/configuration_spec.rb +0 -42
  82. data/spec/models/aggregate_list_value_spec.rb +0 -34
  83. data/spec/models/aggregate_spec.rb +0 -40
  84. data/spec/models/analytical_result_all_of_spec.rb +0 -58
  85. data/spec/models/analytical_result_spec.rb +0 -58
  86. data/spec/models/animation_all_of_spec.rb +0 -34
  87. data/spec/models/animation_spec.rb +0 -34
  88. data/spec/models/bitmap_spec.rb +0 -68
  89. data/spec/models/blob_spec.rb +0 -52
  90. data/spec/models/boolean_value_spec.rb +0 -34
  91. data/spec/models/clipping_plane_spec.rb +0 -40
  92. data/spec/models/coloring_spec.rb +0 -40
  93. data/spec/models/column_request_spec.rb +0 -56
  94. data/spec/models/component_spec.rb +0 -46
  95. data/spec/models/components_spec.rb +0 -46
  96. data/spec/models/contact_list_spec.rb +0 -46
  97. data/spec/models/contact_spec.rb +0 -40
  98. data/spec/models/conversation_create_spec.rb +0 -64
  99. data/spec/models/conversation_list_spec.rb +0 -46
  100. data/spec/models/conversation_spec.rb +0 -122
  101. data/spec/models/conversation_tenant_spec.rb +0 -58
  102. data/spec/models/conversation_update_spec.rb +0 -68
  103. data/spec/models/entity_key_spec.rb +0 -40
  104. data/spec/models/exception_message_spec.rb +0 -52
  105. data/spec/models/file_all_of_spec.rb +0 -58
  106. data/spec/models/file_spec.rb +0 -58
  107. data/spec/models/int32_value_spec.rb +0 -34
  108. data/spec/models/key_frame_spec.rb +0 -46
  109. data/spec/models/line_spec.rb +0 -40
  110. data/spec/models/message_content_spec.rb +0 -34
  111. data/spec/models/message_create_spec.rb +0 -64
  112. data/spec/models/message_list_spec.rb +0 -46
  113. data/spec/models/message_part_spec.rb +0 -46
  114. data/spec/models/message_spec.rb +0 -146
  115. data/spec/models/message_update_spec.rb +0 -68
  116. data/spec/models/orthogonal_camera_spec.rb +0 -64
  117. data/spec/models/participant_spec.rb +0 -40
  118. data/spec/models/participant_with_role_create_spec.rb +0 -44
  119. data/spec/models/participant_with_role_list_spec.rb +0 -46
  120. data/spec/models/participant_with_role_spec.rb +0 -62
  121. data/spec/models/participant_with_role_update_spec.rb +0 -44
  122. data/spec/models/perspective_camera_spec.rb +0 -64
  123. data/spec/models/pie_chart_all_of_spec.rb +0 -52
  124. data/spec/models/pie_chart_spec.rb +0 -52
  125. data/spec/models/point_spec.rb +0 -40
  126. data/spec/models/preview_row_spec.rb +0 -34
  127. data/spec/models/schedule_all_of_spec.rb +0 -58
  128. data/spec/models/schedule_column_spec.rb +0 -118
  129. data/spec/models/schedule_request_all_of_spec.rb +0 -46
  130. data/spec/models/schedule_request_spec.rb +0 -46
  131. data/spec/models/schedule_spec.rb +0 -58
  132. data/spec/models/section_box_spec.rb +0 -70
  133. data/spec/models/sheet_all_of_spec.rb +0 -58
  134. data/spec/models/sheet_part_spec.rb +0 -58
  135. data/spec/models/sheet_spec.rb +0 -58
  136. data/spec/models/snapshot_spec.rb +0 -50
  137. data/spec/models/text_spec.rb +0 -28
  138. data/spec/models/view_all_of_spec.rb +0 -40
  139. data/spec/models/view_setup_hints_spec.rb +0 -46
  140. data/spec/models/view_spec.rb +0 -40
  141. data/spec/models/viewpoint_spec.rb +0 -82
  142. data/spec/models/visibility_spec.rb +0 -46
  143. data/spec/spec_helper.rb +0 -111
  144. data/xbim_comms.gemspec +0 -38
@@ -1,252 +0,0 @@
1
- =begin
2
- #Flex Comms API 2.0
3
-
4
- #Communication centralised around construction data
5
-
6
- The version of the OpenAPI document: 2.0
7
- Contact: info@xbim.net
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module XbimComms
17
- class ScheduleRequest < MessagePart
18
- attr_accessor :schedule_name
19
-
20
- attr_accessor :entities
21
-
22
- attr_accessor :columns
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'schedule_name' => :'scheduleName',
28
- :'entities' => :'entities',
29
- :'columns' => :'columns'
30
- }
31
- end
32
-
33
- # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
34
- def self.acceptable_attributes
35
- attribute_map.values.concat(superclass.acceptable_attributes)
36
- end
37
-
38
- # Attribute type mapping.
39
- def self.openapi_types
40
- {
41
- :'schedule_name' => :'String',
42
- :'entities' => :'Array<EntityKey>',
43
- :'columns' => :'Array<ColumnRequest>'
44
- }
45
- end
46
-
47
- # List of attributes with nullable: true
48
- def self.openapi_nullable
49
- Set.new([
50
- ])
51
- end
52
-
53
- # List of class defined in allOf (OpenAPI v3)
54
- def self.openapi_all_of
55
- [
56
- :'MessagePart',
57
- :'ScheduleRequestAllOf'
58
- ]
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimComms::ScheduleRequest` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimComms::ScheduleRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- # call parent's initialize
77
- super(attributes)
78
-
79
- if attributes.key?(:'schedule_name')
80
- self.schedule_name = attributes[:'schedule_name']
81
- end
82
-
83
- if attributes.key?(:'entities')
84
- if (value = attributes[:'entities']).is_a?(Array)
85
- self.entities = value
86
- end
87
- end
88
-
89
- if attributes.key?(:'columns')
90
- if (value = attributes[:'columns']).is_a?(Array)
91
- self.columns = value
92
- end
93
- end
94
- end
95
-
96
- # Show invalid properties with the reasons. Usually used together with valid?
97
- # @return Array for valid properties with the reasons
98
- def list_invalid_properties
99
- invalid_properties = super
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- true && super
107
- end
108
-
109
- # Checks equality by comparing each attribute.
110
- # @param [Object] Object to be compared
111
- def ==(o)
112
- return true if self.equal?(o)
113
- self.class == o.class &&
114
- schedule_name == o.schedule_name &&
115
- entities == o.entities &&
116
- columns == o.columns && super(o)
117
- end
118
-
119
- # @see the `==` method
120
- # @param [Object] Object to be compared
121
- def eql?(o)
122
- self == o
123
- end
124
-
125
- # Calculates hash code according to all attributes.
126
- # @return [Integer] Hash code
127
- def hash
128
- [schedule_name, entities, columns].hash
129
- end
130
-
131
- # Builds the object from hash
132
- # @param [Hash] attributes Model attributes in the form of hash
133
- # @return [Object] Returns the model itself
134
- def self.build_from_hash(attributes)
135
- new.build_from_hash(attributes)
136
- end
137
-
138
- # Builds the object from hash
139
- # @param [Hash] attributes Model attributes in the form of hash
140
- # @return [Object] Returns the model itself
141
- def build_from_hash(attributes)
142
- return nil unless attributes.is_a?(Hash)
143
- super(attributes)
144
- self.class.openapi_types.each_pair do |key, type|
145
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
- self.send("#{key}=", nil)
147
- elsif type =~ /\AArray<(.*)>/i
148
- # check to ensure the input is an array given that the attribute
149
- # is documented as an array but the input is not
150
- if attributes[self.class.attribute_map[key]].is_a?(Array)
151
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
- end
153
- elsif !attributes[self.class.attribute_map[key]].nil?
154
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
- end
156
- end
157
-
158
- self
159
- end
160
-
161
- # Deserializes the data based on type
162
- # @param string type Data type
163
- # @param string value Value to be deserialized
164
- # @return [Object] Deserialized data
165
- def _deserialize(type, value)
166
- case type.to_sym
167
- when :Time
168
- Time.parse(value)
169
- when :Date
170
- Date.parse(value)
171
- when :String
172
- value.to_s
173
- when :Integer
174
- value.to_i
175
- when :Float
176
- value.to_f
177
- when :Boolean
178
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
- true
180
- else
181
- false
182
- end
183
- when :Object
184
- # generic object (usually a Hash), return directly
185
- value
186
- when /\AArray<(?<inner_type>.+)>\z/
187
- inner_type = Regexp.last_match[:inner_type]
188
- value.map { |v| _deserialize(inner_type, v) }
189
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
- k_type = Regexp.last_match[:k_type]
191
- v_type = Regexp.last_match[:v_type]
192
- {}.tap do |hash|
193
- value.each do |k, v|
194
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
- end
196
- end
197
- else # model
198
- # models (e.g. Pet) or oneOf
199
- klass = XbimComms.const_get(type)
200
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
- end
202
- end
203
-
204
- # Returns the string representation of the object
205
- # @return [String] String presentation of the object
206
- def to_s
207
- to_hash.to_s
208
- end
209
-
210
- # to_body is an alias to to_hash (backward compatibility)
211
- # @return [Hash] Returns the object in the form of hash
212
- def to_body
213
- to_hash
214
- end
215
-
216
- # Returns the object in the form of hash
217
- # @return [Hash] Returns the object in the form of hash
218
- def to_hash
219
- hash = super
220
- self.class.attribute_map.each_pair do |attr, param|
221
- value = self.send(attr)
222
- if value.nil?
223
- is_nullable = self.class.openapi_nullable.include?(attr)
224
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
- end
226
-
227
- hash[param] = _to_hash(value)
228
- end
229
- hash
230
- end
231
-
232
- # Outputs non-array value in the form of hash
233
- # For object, use to_hash. Otherwise, just return the value
234
- # @param [Object] value Any valid value
235
- # @return [Hash] Returns the value in the form of hash
236
- def _to_hash(value)
237
- if value.is_a?(Array)
238
- value.compact.map { |v| _to_hash(v) }
239
- elsif value.is_a?(Hash)
240
- {}.tap do |hash|
241
- value.each { |k, v| hash[k] = _to_hash(v) }
242
- end
243
- elsif value.respond_to? :to_hash
244
- value.to_hash
245
- else
246
- value
247
- end
248
- end
249
-
250
- end
251
-
252
- end
@@ -1,240 +0,0 @@
1
- =begin
2
- #Flex Comms API 2.0
3
-
4
- #Communication centralised around construction data
5
-
6
- The version of the OpenAPI document: 2.0
7
- Contact: info@xbim.net
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module XbimComms
17
- class ScheduleRequestAllOf
18
- attr_accessor :schedule_name
19
-
20
- attr_accessor :entities
21
-
22
- attr_accessor :columns
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'schedule_name' => :'scheduleName',
28
- :'entities' => :'entities',
29
- :'columns' => :'columns'
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
- :'schedule_name' => :'String',
42
- :'entities' => :'Array<EntityKey>',
43
- :'columns' => :'Array<ColumnRequest>'
44
- }
45
- end
46
-
47
- # List of attributes with nullable: true
48
- def self.openapi_nullable
49
- Set.new([
50
- ])
51
- end
52
-
53
- # Initializes the object
54
- # @param [Hash] attributes Model attributes in the form of hash
55
- def initialize(attributes = {})
56
- if (!attributes.is_a?(Hash))
57
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimComms::ScheduleRequestAllOf` initialize method"
58
- end
59
-
60
- # check to see if the attribute exists and convert string to symbol for hash key
61
- attributes = attributes.each_with_object({}) { |(k, v), h|
62
- if (!self.class.attribute_map.key?(k.to_sym))
63
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimComms::ScheduleRequestAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
- end
65
- h[k.to_sym] = v
66
- }
67
-
68
- if attributes.key?(:'schedule_name')
69
- self.schedule_name = attributes[:'schedule_name']
70
- end
71
-
72
- if attributes.key?(:'entities')
73
- if (value = attributes[:'entities']).is_a?(Array)
74
- self.entities = value
75
- end
76
- end
77
-
78
- if attributes.key?(:'columns')
79
- if (value = attributes[:'columns']).is_a?(Array)
80
- self.columns = value
81
- end
82
- end
83
- end
84
-
85
- # Show invalid properties with the reasons. Usually used together with valid?
86
- # @return Array for valid properties with the reasons
87
- def list_invalid_properties
88
- invalid_properties = Array.new
89
- invalid_properties
90
- end
91
-
92
- # Check to see if the all the properties in the model are valid
93
- # @return true if the model is valid
94
- def valid?
95
- true
96
- end
97
-
98
- # Checks equality by comparing each attribute.
99
- # @param [Object] Object to be compared
100
- def ==(o)
101
- return true if self.equal?(o)
102
- self.class == o.class &&
103
- schedule_name == o.schedule_name &&
104
- entities == o.entities &&
105
- columns == o.columns
106
- end
107
-
108
- # @see the `==` method
109
- # @param [Object] Object to be compared
110
- def eql?(o)
111
- self == o
112
- end
113
-
114
- # Calculates hash code according to all attributes.
115
- # @return [Integer] Hash code
116
- def hash
117
- [schedule_name, entities, columns].hash
118
- end
119
-
120
- # Builds the object from hash
121
- # @param [Hash] attributes Model attributes in the form of hash
122
- # @return [Object] Returns the model itself
123
- def self.build_from_hash(attributes)
124
- new.build_from_hash(attributes)
125
- end
126
-
127
- # Builds the object from hash
128
- # @param [Hash] attributes Model attributes in the form of hash
129
- # @return [Object] Returns the model itself
130
- def build_from_hash(attributes)
131
- return nil unless attributes.is_a?(Hash)
132
- self.class.openapi_types.each_pair do |key, type|
133
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
- self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
139
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
- end
141
- elsif !attributes[self.class.attribute_map[key]].nil?
142
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
- end
144
- end
145
-
146
- self
147
- end
148
-
149
- # Deserializes the data based on type
150
- # @param string type Data type
151
- # @param string value Value to be deserialized
152
- # @return [Object] Deserialized data
153
- def _deserialize(type, value)
154
- case type.to_sym
155
- when :Time
156
- Time.parse(value)
157
- when :Date
158
- Date.parse(value)
159
- when :String
160
- value.to_s
161
- when :Integer
162
- value.to_i
163
- when :Float
164
- value.to_f
165
- when :Boolean
166
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
- true
168
- else
169
- false
170
- end
171
- when :Object
172
- # generic object (usually a Hash), return directly
173
- value
174
- when /\AArray<(?<inner_type>.+)>\z/
175
- inner_type = Regexp.last_match[:inner_type]
176
- value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
- k_type = Regexp.last_match[:k_type]
179
- v_type = Regexp.last_match[:v_type]
180
- {}.tap do |hash|
181
- value.each do |k, v|
182
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
- end
184
- end
185
- else # model
186
- # models (e.g. Pet) or oneOf
187
- klass = XbimComms.const_get(type)
188
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
- end
190
- end
191
-
192
- # Returns the string representation of the object
193
- # @return [String] String presentation of the object
194
- def to_s
195
- to_hash.to_s
196
- end
197
-
198
- # to_body is an alias to to_hash (backward compatibility)
199
- # @return [Hash] Returns the object in the form of hash
200
- def to_body
201
- to_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
- # Outputs non-array value in the form of hash
221
- # For object, use to_hash. Otherwise, just return the value
222
- # @param [Object] value Any valid value
223
- # @return [Hash] Returns the value in the form of hash
224
- def _to_hash(value)
225
- if value.is_a?(Array)
226
- value.compact.map { |v| _to_hash(v) }
227
- elsif value.is_a?(Hash)
228
- {}.tap do |hash|
229
- value.each { |k, v| hash[k] = _to_hash(v) }
230
- end
231
- elsif value.respond_to? :to_hash
232
- value.to_hash
233
- else
234
- value
235
- end
236
- end
237
-
238
- end
239
-
240
- end