xbim_comms 2.0.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +5 -148
- data/Gemfile +0 -9
- data/README.md +0 -210
- data/Rakefile +0 -10
- data/lib/xbim_comms/api/contacts_api.rb +0 -206
- data/lib/xbim_comms/api/conversations_api.rb +0 -2670
- data/lib/xbim_comms/api/files_api.rb +0 -107
- data/lib/xbim_comms/api/snapshots_api.rb +0 -100
- data/lib/xbim_comms/api_client.rb +0 -390
- data/lib/xbim_comms/api_error.rb +0 -57
- data/lib/xbim_comms/configuration.rb +0 -278
- data/lib/xbim_comms/models/aggregate.rb +0 -227
- data/lib/xbim_comms/models/aggregate_list_value.rb +0 -220
- data/lib/xbim_comms/models/analytical_result.rb +0 -270
- data/lib/xbim_comms/models/analytical_result_all_of.rb +0 -258
- data/lib/xbim_comms/models/animation.rb +0 -232
- data/lib/xbim_comms/models/animation_all_of.rb +0 -220
- data/lib/xbim_comms/models/bitmap.rb +0 -303
- data/lib/xbim_comms/models/blob.rb +0 -245
- data/lib/xbim_comms/models/boolean_value.rb +0 -218
- data/lib/xbim_comms/models/clipping_plane.rb +0 -231
- data/lib/xbim_comms/models/coloring.rb +0 -229
- data/lib/xbim_comms/models/column_request.rb +0 -279
- data/lib/xbim_comms/models/component.rb +0 -236
- data/lib/xbim_comms/models/components.rb +0 -240
- data/lib/xbim_comms/models/contact.rb +0 -227
- data/lib/xbim_comms/models/contact_list.rb +0 -238
- data/lib/xbim_comms/models/conversation.rb +0 -392
- data/lib/xbim_comms/models/conversation_create.rb +0 -273
- data/lib/xbim_comms/models/conversation_list.rb +0 -238
- data/lib/xbim_comms/models/conversation_tenant.rb +0 -254
- data/lib/xbim_comms/models/conversation_update.rb +0 -302
- data/lib/xbim_comms/models/entity_key.rb +0 -227
- data/lib/xbim_comms/models/exception_message.rb +0 -245
- data/lib/xbim_comms/models/file.rb +0 -266
- data/lib/xbim_comms/models/file_all_of.rb +0 -254
- data/lib/xbim_comms/models/int32_value.rb +0 -218
- data/lib/xbim_comms/models/key_frame.rb +0 -236
- data/lib/xbim_comms/models/line.rb +0 -231
- data/lib/xbim_comms/models/message.rb +0 -416
- data/lib/xbim_comms/models/message_content.rb +0 -220
- data/lib/xbim_comms/models/message_create.rb +0 -273
- data/lib/xbim_comms/models/message_list.rb +0 -238
- data/lib/xbim_comms/models/message_part.rb +0 -246
- data/lib/xbim_comms/models/message_update.rb +0 -297
- data/lib/xbim_comms/models/orthogonal_camera.rb +0 -269
- data/lib/xbim_comms/models/participant.rb +0 -232
- data/lib/xbim_comms/models/participant_with_role.rb +0 -293
- data/lib/xbim_comms/models/participant_with_role_create.rb +0 -266
- data/lib/xbim_comms/models/participant_with_role_list.rb +0 -238
- data/lib/xbim_comms/models/participant_with_role_update.rb +0 -261
- data/lib/xbim_comms/models/perspective_camera.rb +0 -269
- data/lib/xbim_comms/models/pie_chart.rb +0 -257
- data/lib/xbim_comms/models/pie_chart_all_of.rb +0 -245
- data/lib/xbim_comms/models/point.rb +0 -227
- data/lib/xbim_comms/models/preview_row.rb +0 -220
- data/lib/xbim_comms/models/schedule.rb +0 -270
- data/lib/xbim_comms/models/schedule_all_of.rb +0 -258
- data/lib/xbim_comms/models/schedule_column.rb +0 -384
- data/lib/xbim_comms/models/schedule_request.rb +0 -252
- data/lib/xbim_comms/models/schedule_request_all_of.rb +0 -240
- data/lib/xbim_comms/models/section_box.rb +0 -274
- data/lib/xbim_comms/models/sheet.rb +0 -268
- data/lib/xbim_comms/models/sheet_all_of.rb +0 -256
- data/lib/xbim_comms/models/sheet_part.rb +0 -254
- data/lib/xbim_comms/models/snapshot.rb +0 -270
- data/lib/xbim_comms/models/text.rb +0 -220
- data/lib/xbim_comms/models/view.rb +0 -239
- data/lib/xbim_comms/models/view_all_of.rb +0 -227
- data/lib/xbim_comms/models/view_setup_hints.rb +0 -236
- data/lib/xbim_comms/models/viewpoint.rb +0 -296
- data/lib/xbim_comms/models/visibility.rb +0 -238
- data/lib/xbim_comms/version.rb +0 -15
- data/lib/xbim_comms.rb +0 -104
- data/spec/api/contacts_api_spec.rb +0 -74
- data/spec/api/conversations_api_spec.rb +0 -521
- data/spec/api/files_api_spec.rb +0 -50
- data/spec/api/snapshots_api_spec.rb +0 -49
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/aggregate_list_value_spec.rb +0 -34
- data/spec/models/aggregate_spec.rb +0 -40
- data/spec/models/analytical_result_all_of_spec.rb +0 -58
- data/spec/models/analytical_result_spec.rb +0 -58
- data/spec/models/animation_all_of_spec.rb +0 -34
- data/spec/models/animation_spec.rb +0 -34
- data/spec/models/bitmap_spec.rb +0 -68
- data/spec/models/blob_spec.rb +0 -52
- data/spec/models/boolean_value_spec.rb +0 -34
- data/spec/models/clipping_plane_spec.rb +0 -40
- data/spec/models/coloring_spec.rb +0 -40
- data/spec/models/column_request_spec.rb +0 -56
- data/spec/models/component_spec.rb +0 -46
- data/spec/models/components_spec.rb +0 -46
- data/spec/models/contact_list_spec.rb +0 -46
- data/spec/models/contact_spec.rb +0 -40
- data/spec/models/conversation_create_spec.rb +0 -64
- data/spec/models/conversation_list_spec.rb +0 -46
- data/spec/models/conversation_spec.rb +0 -122
- data/spec/models/conversation_tenant_spec.rb +0 -58
- data/spec/models/conversation_update_spec.rb +0 -68
- data/spec/models/entity_key_spec.rb +0 -40
- data/spec/models/exception_message_spec.rb +0 -52
- data/spec/models/file_all_of_spec.rb +0 -58
- data/spec/models/file_spec.rb +0 -58
- data/spec/models/int32_value_spec.rb +0 -34
- data/spec/models/key_frame_spec.rb +0 -46
- data/spec/models/line_spec.rb +0 -40
- data/spec/models/message_content_spec.rb +0 -34
- data/spec/models/message_create_spec.rb +0 -64
- data/spec/models/message_list_spec.rb +0 -46
- data/spec/models/message_part_spec.rb +0 -46
- data/spec/models/message_spec.rb +0 -146
- data/spec/models/message_update_spec.rb +0 -68
- data/spec/models/orthogonal_camera_spec.rb +0 -64
- data/spec/models/participant_spec.rb +0 -40
- data/spec/models/participant_with_role_create_spec.rb +0 -44
- data/spec/models/participant_with_role_list_spec.rb +0 -46
- data/spec/models/participant_with_role_spec.rb +0 -62
- data/spec/models/participant_with_role_update_spec.rb +0 -44
- data/spec/models/perspective_camera_spec.rb +0 -64
- data/spec/models/pie_chart_all_of_spec.rb +0 -52
- data/spec/models/pie_chart_spec.rb +0 -52
- data/spec/models/point_spec.rb +0 -40
- data/spec/models/preview_row_spec.rb +0 -34
- data/spec/models/schedule_all_of_spec.rb +0 -58
- data/spec/models/schedule_column_spec.rb +0 -118
- data/spec/models/schedule_request_all_of_spec.rb +0 -46
- data/spec/models/schedule_request_spec.rb +0 -46
- data/spec/models/schedule_spec.rb +0 -58
- data/spec/models/section_box_spec.rb +0 -70
- data/spec/models/sheet_all_of_spec.rb +0 -58
- data/spec/models/sheet_part_spec.rb +0 -58
- data/spec/models/sheet_spec.rb +0 -58
- data/spec/models/snapshot_spec.rb +0 -50
- data/spec/models/text_spec.rb +0 -28
- data/spec/models/view_all_of_spec.rb +0 -40
- data/spec/models/view_setup_hints_spec.rb +0 -46
- data/spec/models/view_spec.rb +0 -40
- data/spec/models/viewpoint_spec.rb +0 -82
- data/spec/models/visibility_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -111
- data/xbim_comms-1.0.0.gem +0 -0
- data/xbim_comms.gemspec +0 -38
@@ -1,231 +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 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
|
@@ -1,416 +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 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
|