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