xbim_comms 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +210 -0
  4. data/Rakefile +10 -0
  5. data/lib/xbim_comms/api/contacts_api.rb +206 -0
  6. data/lib/xbim_comms/api/conversations_api.rb +2670 -0
  7. data/lib/xbim_comms/api/files_api.rb +107 -0
  8. data/lib/xbim_comms/api/snapshots_api.rb +100 -0
  9. data/lib/xbim_comms/api_client.rb +390 -0
  10. data/lib/xbim_comms/api_error.rb +57 -0
  11. data/lib/xbim_comms/configuration.rb +278 -0
  12. data/lib/xbim_comms/models/aggregate.rb +227 -0
  13. data/lib/xbim_comms/models/aggregate_list_value.rb +220 -0
  14. data/lib/xbim_comms/models/analytical_result.rb +270 -0
  15. data/lib/xbim_comms/models/analytical_result_all_of.rb +258 -0
  16. data/lib/xbim_comms/models/animation.rb +232 -0
  17. data/lib/xbim_comms/models/animation_all_of.rb +220 -0
  18. data/lib/xbim_comms/models/bitmap.rb +303 -0
  19. data/lib/xbim_comms/models/blob.rb +245 -0
  20. data/lib/xbim_comms/models/boolean_value.rb +218 -0
  21. data/lib/xbim_comms/models/clipping_plane.rb +231 -0
  22. data/lib/xbim_comms/models/coloring.rb +229 -0
  23. data/lib/xbim_comms/models/column_request.rb +279 -0
  24. data/lib/xbim_comms/models/component.rb +236 -0
  25. data/lib/xbim_comms/models/components.rb +240 -0
  26. data/lib/xbim_comms/models/contact.rb +227 -0
  27. data/lib/xbim_comms/models/contact_list.rb +238 -0
  28. data/lib/xbim_comms/models/conversation.rb +392 -0
  29. data/lib/xbim_comms/models/conversation_create.rb +273 -0
  30. data/lib/xbim_comms/models/conversation_list.rb +238 -0
  31. data/lib/xbim_comms/models/conversation_tenant.rb +254 -0
  32. data/lib/xbim_comms/models/conversation_update.rb +302 -0
  33. data/lib/xbim_comms/models/entity_key.rb +227 -0
  34. data/lib/xbim_comms/models/exception_message.rb +245 -0
  35. data/lib/xbim_comms/models/file.rb +266 -0
  36. data/lib/xbim_comms/models/file_all_of.rb +254 -0
  37. data/lib/xbim_comms/models/int32_value.rb +218 -0
  38. data/lib/xbim_comms/models/key_frame.rb +236 -0
  39. data/lib/xbim_comms/models/line.rb +231 -0
  40. data/lib/xbim_comms/models/message.rb +416 -0
  41. data/lib/xbim_comms/models/message_content.rb +220 -0
  42. data/lib/xbim_comms/models/message_create.rb +273 -0
  43. data/lib/xbim_comms/models/message_list.rb +238 -0
  44. data/lib/xbim_comms/models/message_part.rb +246 -0
  45. data/lib/xbim_comms/models/message_update.rb +297 -0
  46. data/lib/xbim_comms/models/orthogonal_camera.rb +269 -0
  47. data/lib/xbim_comms/models/participant.rb +232 -0
  48. data/lib/xbim_comms/models/participant_with_role.rb +293 -0
  49. data/lib/xbim_comms/models/participant_with_role_create.rb +266 -0
  50. data/lib/xbim_comms/models/participant_with_role_list.rb +238 -0
  51. data/lib/xbim_comms/models/participant_with_role_update.rb +261 -0
  52. data/lib/xbim_comms/models/perspective_camera.rb +269 -0
  53. data/lib/xbim_comms/models/pie_chart.rb +257 -0
  54. data/lib/xbim_comms/models/pie_chart_all_of.rb +245 -0
  55. data/lib/xbim_comms/models/point.rb +227 -0
  56. data/lib/xbim_comms/models/preview_row.rb +220 -0
  57. data/lib/xbim_comms/models/schedule.rb +270 -0
  58. data/lib/xbim_comms/models/schedule_all_of.rb +258 -0
  59. data/lib/xbim_comms/models/schedule_column.rb +384 -0
  60. data/lib/xbim_comms/models/schedule_request.rb +252 -0
  61. data/lib/xbim_comms/models/schedule_request_all_of.rb +240 -0
  62. data/lib/xbim_comms/models/section_box.rb +274 -0
  63. data/lib/xbim_comms/models/sheet.rb +268 -0
  64. data/lib/xbim_comms/models/sheet_all_of.rb +256 -0
  65. data/lib/xbim_comms/models/sheet_part.rb +254 -0
  66. data/lib/xbim_comms/models/snapshot.rb +270 -0
  67. data/lib/xbim_comms/models/text.rb +220 -0
  68. data/lib/xbim_comms/models/view.rb +239 -0
  69. data/lib/xbim_comms/models/view_all_of.rb +227 -0
  70. data/lib/xbim_comms/models/view_setup_hints.rb +236 -0
  71. data/lib/xbim_comms/models/viewpoint.rb +296 -0
  72. data/lib/xbim_comms/models/visibility.rb +238 -0
  73. data/lib/xbim_comms/version.rb +15 -0
  74. data/lib/xbim_comms.rb +104 -0
  75. data/spec/api/contacts_api_spec.rb +74 -0
  76. data/spec/api/conversations_api_spec.rb +521 -0
  77. data/spec/api/files_api_spec.rb +50 -0
  78. data/spec/api/snapshots_api_spec.rb +49 -0
  79. data/spec/api_client_spec.rb +226 -0
  80. data/spec/configuration_spec.rb +42 -0
  81. data/spec/models/aggregate_list_value_spec.rb +34 -0
  82. data/spec/models/aggregate_spec.rb +40 -0
  83. data/spec/models/analytical_result_all_of_spec.rb +58 -0
  84. data/spec/models/analytical_result_spec.rb +58 -0
  85. data/spec/models/animation_all_of_spec.rb +34 -0
  86. data/spec/models/animation_spec.rb +34 -0
  87. data/spec/models/bitmap_spec.rb +68 -0
  88. data/spec/models/blob_spec.rb +52 -0
  89. data/spec/models/boolean_value_spec.rb +34 -0
  90. data/spec/models/clipping_plane_spec.rb +40 -0
  91. data/spec/models/coloring_spec.rb +40 -0
  92. data/spec/models/column_request_spec.rb +56 -0
  93. data/spec/models/component_spec.rb +46 -0
  94. data/spec/models/components_spec.rb +46 -0
  95. data/spec/models/contact_list_spec.rb +46 -0
  96. data/spec/models/contact_spec.rb +40 -0
  97. data/spec/models/conversation_create_spec.rb +64 -0
  98. data/spec/models/conversation_list_spec.rb +46 -0
  99. data/spec/models/conversation_spec.rb +122 -0
  100. data/spec/models/conversation_tenant_spec.rb +58 -0
  101. data/spec/models/conversation_update_spec.rb +68 -0
  102. data/spec/models/entity_key_spec.rb +40 -0
  103. data/spec/models/exception_message_spec.rb +52 -0
  104. data/spec/models/file_all_of_spec.rb +58 -0
  105. data/spec/models/file_spec.rb +58 -0
  106. data/spec/models/int32_value_spec.rb +34 -0
  107. data/spec/models/key_frame_spec.rb +46 -0
  108. data/spec/models/line_spec.rb +40 -0
  109. data/spec/models/message_content_spec.rb +34 -0
  110. data/spec/models/message_create_spec.rb +64 -0
  111. data/spec/models/message_list_spec.rb +46 -0
  112. data/spec/models/message_part_spec.rb +46 -0
  113. data/spec/models/message_spec.rb +146 -0
  114. data/spec/models/message_update_spec.rb +68 -0
  115. data/spec/models/orthogonal_camera_spec.rb +64 -0
  116. data/spec/models/participant_spec.rb +40 -0
  117. data/spec/models/participant_with_role_create_spec.rb +44 -0
  118. data/spec/models/participant_with_role_list_spec.rb +46 -0
  119. data/spec/models/participant_with_role_spec.rb +62 -0
  120. data/spec/models/participant_with_role_update_spec.rb +44 -0
  121. data/spec/models/perspective_camera_spec.rb +64 -0
  122. data/spec/models/pie_chart_all_of_spec.rb +52 -0
  123. data/spec/models/pie_chart_spec.rb +52 -0
  124. data/spec/models/point_spec.rb +40 -0
  125. data/spec/models/preview_row_spec.rb +34 -0
  126. data/spec/models/schedule_all_of_spec.rb +58 -0
  127. data/spec/models/schedule_column_spec.rb +118 -0
  128. data/spec/models/schedule_request_all_of_spec.rb +46 -0
  129. data/spec/models/schedule_request_spec.rb +46 -0
  130. data/spec/models/schedule_spec.rb +58 -0
  131. data/spec/models/section_box_spec.rb +70 -0
  132. data/spec/models/sheet_all_of_spec.rb +58 -0
  133. data/spec/models/sheet_part_spec.rb +58 -0
  134. data/spec/models/sheet_spec.rb +58 -0
  135. data/spec/models/snapshot_spec.rb +50 -0
  136. data/spec/models/text_spec.rb +28 -0
  137. data/spec/models/view_all_of_spec.rb +40 -0
  138. data/spec/models/view_setup_hints_spec.rb +46 -0
  139. data/spec/models/view_spec.rb +40 -0
  140. data/spec/models/viewpoint_spec.rb +82 -0
  141. data/spec/models/visibility_spec.rb +46 -0
  142. data/spec/spec_helper.rb +111 -0
  143. data/xbim_comms-1.0.0.gem +0 -0
  144. data/xbim_comms.gemspec +38 -0
  145. metadata +226 -0
@@ -0,0 +1,231 @@
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 Line
18
+ attr_accessor :start_point
19
+
20
+ attr_accessor :end_point
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'start_point' => :'start_point',
26
+ :'end_point' => :'end_point'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'start_point' => :'Array<Float>',
39
+ :'end_point' => :'Array<Float>'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XbimComms::Line` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XbimComms::Line`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'start_point')
65
+ if (value = attributes[:'start_point']).is_a?(Array)
66
+ self.start_point = value
67
+ end
68
+ end
69
+
70
+ if attributes.key?(:'end_point')
71
+ if (value = attributes[:'end_point']).is_a?(Array)
72
+ self.end_point = value
73
+ end
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ start_point == o.start_point &&
96
+ end_point == o.end_point
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [start_point, end_point].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = XbimComms.const_get(type)
179
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -0,0 +1,416 @@
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 Message
18
+ attr_accessor :id
19
+
20
+ attr_accessor :conversation_id
21
+
22
+ attr_accessor :is_draft
23
+
24
+ attr_accessor :content
25
+
26
+ attr_accessor :author_name
27
+
28
+ attr_accessor :author_email
29
+
30
+ attr_accessor :date_created
31
+
32
+ attr_accessor :model_id
33
+
34
+ attr_accessor :asset_id
35
+
36
+ attr_accessor :trailer
37
+
38
+ attr_accessor :state_changed_time
39
+
40
+ attr_accessor :state
41
+
42
+ attr_accessor :files
43
+
44
+ attr_accessor :default_view
45
+
46
+ attr_accessor :section_box
47
+
48
+ attr_accessor :true_north_angle
49
+
50
+ attr_accessor :html_footer
51
+
52
+ attr_accessor :conversation
53
+
54
+ attr_accessor :author
55
+
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype
58
+ attr_reader :allowable_values
59
+
60
+ def initialize(datatype, allowable_values)
61
+ @allowable_values = allowable_values.map do |value|
62
+ case datatype.to_s
63
+ when /Integer/i
64
+ value.to_i
65
+ when /Float/i
66
+ value.to_f
67
+ else
68
+ value
69
+ end
70
+ end
71
+ end
72
+
73
+ def valid?(value)
74
+ !value || allowable_values.include?(value)
75
+ end
76
+ end
77
+
78
+ # Attribute mapping from ruby-style variable name to JSON key.
79
+ def self.attribute_map
80
+ {
81
+ :'id' => :'id',
82
+ :'conversation_id' => :'conversationID',
83
+ :'is_draft' => :'isDraft',
84
+ :'content' => :'content',
85
+ :'author_name' => :'authorName',
86
+ :'author_email' => :'authorEmail',
87
+ :'date_created' => :'dateCreated',
88
+ :'model_id' => :'modelId',
89
+ :'asset_id' => :'assetId',
90
+ :'trailer' => :'trailer',
91
+ :'state_changed_time' => :'stateChangedTime',
92
+ :'state' => :'state',
93
+ :'files' => :'files',
94
+ :'default_view' => :'defaultView',
95
+ :'section_box' => :'sectionBox',
96
+ :'true_north_angle' => :'trueNorthAngle',
97
+ :'html_footer' => :'htmlFooter',
98
+ :'conversation' => :'conversation',
99
+ :'author' => :'author'
100
+ }
101
+ end
102
+
103
+ # Returns all the JSON keys this model knows about
104
+ def self.acceptable_attributes
105
+ attribute_map.values
106
+ end
107
+
108
+ # Attribute type mapping.
109
+ def self.openapi_types
110
+ {
111
+ :'id' => :'Integer',
112
+ :'conversation_id' => :'Integer',
113
+ :'is_draft' => :'Boolean',
114
+ :'content' => :'MessageContent',
115
+ :'author_name' => :'String',
116
+ :'author_email' => :'String',
117
+ :'date_created' => :'Time',
118
+ :'model_id' => :'Integer',
119
+ :'asset_id' => :'Integer',
120
+ :'trailer' => :'String',
121
+ :'state_changed_time' => :'Time',
122
+ :'state' => :'String',
123
+ :'files' => :'Array<Blob>',
124
+ :'default_view' => :'Viewpoint',
125
+ :'section_box' => :'SectionBox',
126
+ :'true_north_angle' => :'Float',
127
+ :'html_footer' => :'String',
128
+ :'conversation' => :'Conversation',
129
+ :'author' => :'Participant'
130
+ }
131
+ end
132
+
133
+ # List of attributes with nullable: true
134
+ def self.openapi_nullable
135
+ Set.new([
136
+ ])
137
+ end
138
+
139
+ # Initializes the object
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ def initialize(attributes = {})
142
+ if (!attributes.is_a?(Hash))
143
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XbimComms::Message` initialize method"
144
+ end
145
+
146
+ # check to see if the attribute exists and convert string to symbol for hash key
147
+ attributes = attributes.each_with_object({}) { |(k, v), h|
148
+ if (!self.class.attribute_map.key?(k.to_sym))
149
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XbimComms::Message`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
150
+ end
151
+ h[k.to_sym] = v
152
+ }
153
+
154
+ if attributes.key?(:'id')
155
+ self.id = attributes[:'id']
156
+ end
157
+
158
+ if attributes.key?(:'conversation_id')
159
+ self.conversation_id = attributes[:'conversation_id']
160
+ end
161
+
162
+ if attributes.key?(:'is_draft')
163
+ self.is_draft = attributes[:'is_draft']
164
+ end
165
+
166
+ if attributes.key?(:'content')
167
+ self.content = attributes[:'content']
168
+ end
169
+
170
+ if attributes.key?(:'author_name')
171
+ self.author_name = attributes[:'author_name']
172
+ end
173
+
174
+ if attributes.key?(:'author_email')
175
+ self.author_email = attributes[:'author_email']
176
+ end
177
+
178
+ if attributes.key?(:'date_created')
179
+ self.date_created = attributes[:'date_created']
180
+ end
181
+
182
+ if attributes.key?(:'model_id')
183
+ self.model_id = attributes[:'model_id']
184
+ end
185
+
186
+ if attributes.key?(:'asset_id')
187
+ self.asset_id = attributes[:'asset_id']
188
+ end
189
+
190
+ if attributes.key?(:'trailer')
191
+ self.trailer = attributes[:'trailer']
192
+ end
193
+
194
+ if attributes.key?(:'state_changed_time')
195
+ self.state_changed_time = attributes[:'state_changed_time']
196
+ end
197
+
198
+ if attributes.key?(:'state')
199
+ self.state = attributes[:'state']
200
+ end
201
+
202
+ if attributes.key?(:'files')
203
+ if (value = attributes[:'files']).is_a?(Array)
204
+ self.files = value
205
+ end
206
+ end
207
+
208
+ if attributes.key?(:'default_view')
209
+ self.default_view = attributes[:'default_view']
210
+ end
211
+
212
+ if attributes.key?(:'section_box')
213
+ self.section_box = attributes[:'section_box']
214
+ end
215
+
216
+ if attributes.key?(:'true_north_angle')
217
+ self.true_north_angle = attributes[:'true_north_angle']
218
+ end
219
+
220
+ if attributes.key?(:'html_footer')
221
+ self.html_footer = attributes[:'html_footer']
222
+ end
223
+
224
+ if attributes.key?(:'conversation')
225
+ self.conversation = attributes[:'conversation']
226
+ end
227
+
228
+ if attributes.key?(:'author')
229
+ self.author = attributes[:'author']
230
+ end
231
+ end
232
+
233
+ # Show invalid properties with the reasons. Usually used together with valid?
234
+ # @return Array for valid properties with the reasons
235
+ def list_invalid_properties
236
+ invalid_properties = Array.new
237
+ invalid_properties
238
+ end
239
+
240
+ # Check to see if the all the properties in the model are valid
241
+ # @return true if the model is valid
242
+ def valid?
243
+ state_validator = EnumAttributeValidator.new('String', ["NotRead", "Read", "Dismissed"])
244
+ return false unless state_validator.valid?(@state)
245
+ true
246
+ end
247
+
248
+ # Custom attribute writer method checking allowed values (enum).
249
+ # @param [Object] state Object to be assigned
250
+ def state=(state)
251
+ validator = EnumAttributeValidator.new('String', ["NotRead", "Read", "Dismissed"])
252
+ unless validator.valid?(state)
253
+ fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
254
+ end
255
+ @state = state
256
+ end
257
+
258
+ # Checks equality by comparing each attribute.
259
+ # @param [Object] Object to be compared
260
+ def ==(o)
261
+ return true if self.equal?(o)
262
+ self.class == o.class &&
263
+ id == o.id &&
264
+ conversation_id == o.conversation_id &&
265
+ is_draft == o.is_draft &&
266
+ content == o.content &&
267
+ author_name == o.author_name &&
268
+ author_email == o.author_email &&
269
+ date_created == o.date_created &&
270
+ model_id == o.model_id &&
271
+ asset_id == o.asset_id &&
272
+ trailer == o.trailer &&
273
+ state_changed_time == o.state_changed_time &&
274
+ state == o.state &&
275
+ files == o.files &&
276
+ default_view == o.default_view &&
277
+ section_box == o.section_box &&
278
+ true_north_angle == o.true_north_angle &&
279
+ html_footer == o.html_footer &&
280
+ conversation == o.conversation &&
281
+ author == o.author
282
+ end
283
+
284
+ # @see the `==` method
285
+ # @param [Object] Object to be compared
286
+ def eql?(o)
287
+ self == o
288
+ end
289
+
290
+ # Calculates hash code according to all attributes.
291
+ # @return [Integer] Hash code
292
+ def hash
293
+ [id, conversation_id, is_draft, content, author_name, author_email, date_created, model_id, asset_id, trailer, state_changed_time, state, files, default_view, section_box, true_north_angle, html_footer, conversation, author].hash
294
+ end
295
+
296
+ # Builds the object from hash
297
+ # @param [Hash] attributes Model attributes in the form of hash
298
+ # @return [Object] Returns the model itself
299
+ def self.build_from_hash(attributes)
300
+ new.build_from_hash(attributes)
301
+ end
302
+
303
+ # Builds the object from hash
304
+ # @param [Hash] attributes Model attributes in the form of hash
305
+ # @return [Object] Returns the model itself
306
+ def build_from_hash(attributes)
307
+ return nil unless attributes.is_a?(Hash)
308
+ self.class.openapi_types.each_pair do |key, type|
309
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
310
+ self.send("#{key}=", nil)
311
+ elsif type =~ /\AArray<(.*)>/i
312
+ # check to ensure the input is an array given that the attribute
313
+ # is documented as an array but the input is not
314
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
315
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
316
+ end
317
+ elsif !attributes[self.class.attribute_map[key]].nil?
318
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
319
+ end
320
+ end
321
+
322
+ self
323
+ end
324
+
325
+ # Deserializes the data based on type
326
+ # @param string type Data type
327
+ # @param string value Value to be deserialized
328
+ # @return [Object] Deserialized data
329
+ def _deserialize(type, value)
330
+ case type.to_sym
331
+ when :Time
332
+ Time.parse(value)
333
+ when :Date
334
+ Date.parse(value)
335
+ when :String
336
+ value.to_s
337
+ when :Integer
338
+ value.to_i
339
+ when :Float
340
+ value.to_f
341
+ when :Boolean
342
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
343
+ true
344
+ else
345
+ false
346
+ end
347
+ when :Object
348
+ # generic object (usually a Hash), return directly
349
+ value
350
+ when /\AArray<(?<inner_type>.+)>\z/
351
+ inner_type = Regexp.last_match[:inner_type]
352
+ value.map { |v| _deserialize(inner_type, v) }
353
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
354
+ k_type = Regexp.last_match[:k_type]
355
+ v_type = Regexp.last_match[:v_type]
356
+ {}.tap do |hash|
357
+ value.each do |k, v|
358
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
359
+ end
360
+ end
361
+ else # model
362
+ # models (e.g. Pet) or oneOf
363
+ klass = XbimComms.const_get(type)
364
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
365
+ end
366
+ end
367
+
368
+ # Returns the string representation of the object
369
+ # @return [String] String presentation of the object
370
+ def to_s
371
+ to_hash.to_s
372
+ end
373
+
374
+ # to_body is an alias to to_hash (backward compatibility)
375
+ # @return [Hash] Returns the object in the form of hash
376
+ def to_body
377
+ to_hash
378
+ end
379
+
380
+ # Returns the object in the form of hash
381
+ # @return [Hash] Returns the object in the form of hash
382
+ def to_hash
383
+ hash = {}
384
+ self.class.attribute_map.each_pair do |attr, param|
385
+ value = self.send(attr)
386
+ if value.nil?
387
+ is_nullable = self.class.openapi_nullable.include?(attr)
388
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
389
+ end
390
+
391
+ hash[param] = _to_hash(value)
392
+ end
393
+ hash
394
+ end
395
+
396
+ # Outputs non-array value in the form of hash
397
+ # For object, use to_hash. Otherwise, just return the value
398
+ # @param [Object] value Any valid value
399
+ # @return [Hash] Returns the value in the form of hash
400
+ def _to_hash(value)
401
+ if value.is_a?(Array)
402
+ value.compact.map { |v| _to_hash(v) }
403
+ elsif value.is_a?(Hash)
404
+ {}.tap do |hash|
405
+ value.each { |k, v| hash[k] = _to_hash(v) }
406
+ end
407
+ elsif value.respond_to? :to_hash
408
+ value.to_hash
409
+ else
410
+ value
411
+ end
412
+ end
413
+
414
+ end
415
+
416
+ end