xbim_comms 2.0.1 → 2.0.2

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