xbim_aim 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 -334
- data/Gemfile +0 -9
- data/README.md +0 -413
- data/Rakefile +0 -10
- data/lib/xbim_aim/api/admin_api.rb +0 -358
- data/lib/xbim_aim/api/applications_api.rb +0 -203
- data/lib/xbim_aim/api/assemblies_api.rb +0 -690
- data/lib/xbim_aim/api/assets_api.rb +0 -926
- data/lib/xbim_aim/api/attributes_api.rb +0 -789
- data/lib/xbim_aim/api/component_types_api.rb +0 -690
- data/lib/xbim_aim/api/components_api.rb +0 -803
- data/lib/xbim_aim/api/contacts_api.rb +0 -690
- data/lib/xbim_aim/api/diagnostics_api.rb +0 -109
- data/lib/xbim_aim/api/document_files_api.rb +0 -224
- data/lib/xbim_aim/api/documents_api.rb +0 -690
- data/lib/xbim_aim/api/entities_api.rb +0 -904
- data/lib/xbim_aim/api/facilities_api.rb +0 -690
- data/lib/xbim_aim/api/issues_api.rb +0 -690
- data/lib/xbim_aim/api/jobs_api.rb +0 -690
- data/lib/xbim_aim/api/levels_api.rb +0 -690
- data/lib/xbim_aim/api/logs_api.rb +0 -90
- data/lib/xbim_aim/api/model_files_api.rb +0 -219
- data/lib/xbim_aim/api/model_mapping_api.rb +0 -203
- data/lib/xbim_aim/api/models_api.rb +0 -1308
- data/lib/xbim_aim/api/resources_api.rb +0 -690
- data/lib/xbim_aim/api/schedules_api.rb +0 -496
- data/lib/xbim_aim/api/sites_api.rb +0 -690
- data/lib/xbim_aim/api/spaces_api.rb +0 -803
- data/lib/xbim_aim/api/spares_api.rb +0 -690
- data/lib/xbim_aim/api/stats_api.rb +0 -170
- data/lib/xbim_aim/api/systems_api.rb +0 -690
- data/lib/xbim_aim/api/thumbnails_api.rb +0 -182
- data/lib/xbim_aim/api/wexbim_api.rb +0 -849
- data/lib/xbim_aim/api/zones_api.rb +0 -690
- data/lib/xbim_aim/api_client.rb +0 -390
- data/lib/xbim_aim/api_error.rb +0 -57
- data/lib/xbim_aim/configuration.rb +0 -278
- data/lib/xbim_aim/models/application.rb +0 -277
- data/lib/xbim_aim/models/assembly_diagnostics.rb +0 -299
- data/lib/xbim_aim/models/assembly_info.rb +0 -308
- data/lib/xbim_aim/models/assembly_item.rb +0 -454
- data/lib/xbim_aim/models/asset.rb +0 -339
- data/lib/xbim_aim/models/asset_create.rb +0 -268
- data/lib/xbim_aim/models/asset_edit.rb +0 -263
- data/lib/xbim_aim/models/asset_segment.rb +0 -304
- data/lib/xbim_aim/models/attribute_definition.rb +0 -354
- data/lib/xbim_aim/models/attribute_definition_create.rb +0 -338
- data/lib/xbim_aim/models/attribute_definition_edit.rb +0 -288
- data/lib/xbim_aim/models/attribute_definition_entity.rb +0 -392
- data/lib/xbim_aim/models/attribute_value.rb +0 -333
- data/lib/xbim_aim/models/attribute_value_entity.rb +0 -272
- data/lib/xbim_aim/models/cell.rb +0 -236
- data/lib/xbim_aim/models/classification_node.rb +0 -254
- data/lib/xbim_aim/models/column_definition.rb +0 -297
- data/lib/xbim_aim/models/complex_value_base.rb +0 -261
- data/lib/xbim_aim/models/component.rb +0 -535
- data/lib/xbim_aim/models/component_create.rb +0 -283
- data/lib/xbim_aim/models/component_edit.rb +0 -248
- data/lib/xbim_aim/models/component_info.rb +0 -326
- data/lib/xbim_aim/models/component_type.rb +0 -498
- data/lib/xbim_aim/models/component_type_info.rb +0 -308
- data/lib/xbim_aim/models/contact.rb +0 -443
- data/lib/xbim_aim/models/contact_entity.rb +0 -333
- data/lib/xbim_aim/models/contact_info.rb +0 -308
- data/lib/xbim_aim/models/db_update.rb +0 -227
- data/lib/xbim_aim/models/document.rb +0 -421
- data/lib/xbim_aim/models/document_create.rb +0 -345
- data/lib/xbim_aim/models/document_edit.rb +0 -310
- data/lib/xbim_aim/models/document_info.rb +0 -308
- data/lib/xbim_aim/models/entity.rb +0 -421
- data/lib/xbim_aim/models/entity_base.rb +0 -308
- data/lib/xbim_aim/models/entity_contact.rb +0 -333
- data/lib/xbim_aim/models/entity_create.rb +0 -274
- data/lib/xbim_aim/models/entity_edit.rb +0 -239
- data/lib/xbim_aim/models/entity_mapping_info.rb +0 -299
- data/lib/xbim_aim/models/entity_match_descriptor.rb +0 -245
- data/lib/xbim_aim/models/entity_match_info.rb +0 -238
- data/lib/xbim_aim/models/entity_ref.rb +0 -281
- data/lib/xbim_aim/models/facility.rb +0 -432
- data/lib/xbim_aim/models/facility_info.rb +0 -308
- data/lib/xbim_aim/models/file_upload_result.rb +0 -300
- data/lib/xbim_aim/models/footprint.rb +0 -254
- data/lib/xbim_aim/models/i_metered_resource.rb +0 -254
- data/lib/xbim_aim/models/ifc_type.rb +0 -247
- data/lib/xbim_aim/models/inline_object.rb +0 -294
- data/lib/xbim_aim/models/inline_object1.rb +0 -294
- data/lib/xbim_aim/models/inline_object2.rb +0 -220
- data/lib/xbim_aim/models/inline_object3.rb +0 -223
- data/lib/xbim_aim/models/inline_object4.rb +0 -294
- data/lib/xbim_aim/models/inline_object5.rb +0 -294
- data/lib/xbim_aim/models/issue.rb +0 -443
- data/lib/xbim_aim/models/issue_info.rb +0 -308
- data/lib/xbim_aim/models/job.rb +0 -483
- data/lib/xbim_aim/models/job_create.rb +0 -283
- data/lib/xbim_aim/models/job_edit.rb +0 -248
- data/lib/xbim_aim/models/job_info.rb +0 -308
- data/lib/xbim_aim/models/level.rb +0 -463
- data/lib/xbim_aim/models/level_create.rb +0 -274
- data/lib/xbim_aim/models/level_edit.rb +0 -239
- data/lib/xbim_aim/models/level_info.rb +0 -308
- data/lib/xbim_aim/models/mapping_message_info.rb +0 -281
- data/lib/xbim_aim/models/mapping_properties.rb +0 -227
- data/lib/xbim_aim/models/member_permission.rb +0 -292
- data/lib/xbim_aim/models/member_role.rb +0 -320
- data/lib/xbim_aim/models/model.rb +0 -617
- data/lib/xbim_aim/models/model_create.rb +0 -318
- data/lib/xbim_aim/models/model_edit.rb +0 -284
- data/lib/xbim_aim/models/model_info.rb +0 -380
- data/lib/xbim_aim/models/model_mapping.rb +0 -363
- data/lib/xbim_aim/models/model_mapping_report.rb +0 -354
- data/lib/xbim_aim/models/o_data_list_response_of_application.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_assembly_diagnostics.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_assembly_item.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_asset.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_attribute_definition.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_attribute_definition_entity.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_attribute_value.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_complex_value_base.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_component.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_component_type.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_contact.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_document.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_entity.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_entity_ref.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_facility.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_issue.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_job.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_level.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_member_permission.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_model.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_model_mapping.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_model_mapping_report.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_resource.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_role.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_row.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_schedule.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_site.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_space.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_spare.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_system_item.rb +0 -247
- data/lib/xbim_aim/models/o_data_list_response_of_zone.rb +0 -247
- data/lib/xbim_aim/models/o_data_response_of_boolean.rb +0 -227
- data/lib/xbim_aim/models/quota_status.rb +0 -300
- data/lib/xbim_aim/models/related_entity.rb +0 -432
- data/lib/xbim_aim/models/resource.rb +0 -443
- data/lib/xbim_aim/models/resource_info.rb +0 -308
- data/lib/xbim_aim/models/role.rb +0 -331
- data/lib/xbim_aim/models/role_member.rb +0 -279
- data/lib/xbim_aim/models/row.rb +0 -229
- data/lib/xbim_aim/models/schedule.rb +0 -258
- data/lib/xbim_aim/models/site.rb +0 -432
- data/lib/xbim_aim/models/space.rb +0 -491
- data/lib/xbim_aim/models/space_create.rb +0 -283
- data/lib/xbim_aim/models/space_edit.rb +0 -248
- data/lib/xbim_aim/models/space_info.rb +0 -326
- data/lib/xbim_aim/models/spare.rb +0 -450
- data/lib/xbim_aim/models/spare_create.rb +0 -283
- data/lib/xbim_aim/models/spare_edit.rb +0 -248
- data/lib/xbim_aim/models/spare_info.rb +0 -308
- data/lib/xbim_aim/models/system_info.rb +0 -319
- data/lib/xbim_aim/models/system_item.rb +0 -454
- data/lib/xbim_aim/models/user_permissions.rb +0 -275
- data/lib/xbim_aim/models/value_container.rb +0 -308
- data/lib/xbim_aim/models/zone.rb +0 -454
- data/lib/xbim_aim/models/zone_info.rb +0 -308
- data/lib/xbim_aim/version.rb +0 -15
- data/lib/xbim_aim.rb +0 -197
- data/spec/api/admin_api_spec.rb +0 -95
- data/spec/api/applications_api_spec.rb +0 -71
- data/spec/api/assemblies_api_spec.rb +0 -160
- data/spec/api/assets_api_spec.rb +0 -203
- data/spec/api/attributes_api_spec.rb +0 -177
- data/spec/api/component_types_api_spec.rb +0 -160
- data/spec/api/components_api_spec.rb +0 -184
- data/spec/api/contacts_api_spec.rb +0 -160
- data/spec/api/diagnostics_api_spec.rb +0 -54
- data/spec/api/document_files_api_spec.rb +0 -69
- data/spec/api/documents_api_spec.rb +0 -160
- data/spec/api/entities_api_spec.rb +0 -203
- data/spec/api/facilities_api_spec.rb +0 -160
- data/spec/api/issues_api_spec.rb +0 -160
- data/spec/api/jobs_api_spec.rb +0 -160
- data/spec/api/levels_api_spec.rb +0 -160
- data/spec/api/logs_api_spec.rb +0 -47
- data/spec/api/model_files_api_spec.rb +0 -71
- data/spec/api/model_mapping_api_spec.rb +0 -71
- data/spec/api/models_api_spec.rb +0 -273
- data/spec/api/resources_api_spec.rb +0 -160
- data/spec/api/schedules_api_spec.rb +0 -126
- data/spec/api/sites_api_spec.rb +0 -160
- data/spec/api/spaces_api_spec.rb +0 -184
- data/spec/api/spares_api_spec.rb +0 -160
- data/spec/api/stats_api_spec.rb +0 -61
- data/spec/api/systems_api_spec.rb +0 -160
- data/spec/api/thumbnails_api_spec.rb +0 -63
- data/spec/api/wexbim_api_spec.rb +0 -175
- data/spec/api/zones_api_spec.rb +0 -160
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/application_spec.rb +0 -70
- data/spec/models/assembly_diagnostics_spec.rb +0 -88
- data/spec/models/assembly_info_spec.rb +0 -94
- data/spec/models/assembly_item_spec.rb +0 -178
- data/spec/models/asset_create_spec.rb +0 -44
- data/spec/models/asset_edit_spec.rb +0 -44
- data/spec/models/asset_segment_spec.rb +0 -88
- data/spec/models/asset_spec.rb +0 -92
- data/spec/models/attribute_definition_create_spec.rb +0 -78
- data/spec/models/attribute_definition_edit_spec.rb +0 -62
- data/spec/models/attribute_definition_entity_spec.rb +0 -126
- data/spec/models/attribute_definition_spec.rb +0 -102
- data/spec/models/attribute_value_entity_spec.rb +0 -70
- data/spec/models/attribute_value_spec.rb +0 -92
- data/spec/models/cell_spec.rb +0 -46
- data/spec/models/classification_node_spec.rb +0 -58
- data/spec/models/column_definition_spec.rb +0 -68
- data/spec/models/complex_value_base_spec.rb +0 -44
- data/spec/models/component_create_spec.rb +0 -70
- data/spec/models/component_edit_spec.rb +0 -52
- data/spec/models/component_info_spec.rb +0 -106
- data/spec/models/component_spec.rb +0 -226
- data/spec/models/component_type_info_spec.rb +0 -94
- data/spec/models/component_type_spec.rb +0 -202
- data/spec/models/contact_entity_spec.rb +0 -92
- data/spec/models/contact_info_spec.rb +0 -94
- data/spec/models/contact_spec.rb +0 -172
- data/spec/models/db_update_spec.rb +0 -40
- data/spec/models/document_create_spec.rb +0 -106
- data/spec/models/document_edit_spec.rb +0 -88
- data/spec/models/document_info_spec.rb +0 -94
- data/spec/models/document_spec.rb +0 -160
- data/spec/models/entity_base_spec.rb +0 -94
- data/spec/models/entity_contact_spec.rb +0 -92
- data/spec/models/entity_create_spec.rb +0 -64
- data/spec/models/entity_edit_spec.rb +0 -46
- data/spec/models/entity_mapping_info_spec.rb +0 -88
- data/spec/models/entity_match_descriptor_spec.rb +0 -52
- data/spec/models/entity_match_info_spec.rb +0 -46
- data/spec/models/entity_ref_spec.rb +0 -76
- data/spec/models/entity_spec.rb +0 -160
- data/spec/models/facility_info_spec.rb +0 -94
- data/spec/models/facility_spec.rb +0 -166
- data/spec/models/file_upload_result_spec.rb +0 -82
- data/spec/models/footprint_spec.rb +0 -58
- data/spec/models/i_metered_resource_spec.rb +0 -58
- data/spec/models/ifc_type_spec.rb +0 -52
- data/spec/models/inline_object1_spec.rb +0 -56
- data/spec/models/inline_object2_spec.rb +0 -34
- data/spec/models/inline_object3_spec.rb +0 -34
- data/spec/models/inline_object4_spec.rb +0 -56
- data/spec/models/inline_object5_spec.rb +0 -56
- data/spec/models/inline_object_spec.rb +0 -56
- data/spec/models/issue_info_spec.rb +0 -94
- data/spec/models/issue_spec.rb +0 -172
- data/spec/models/job_create_spec.rb +0 -70
- data/spec/models/job_edit_spec.rb +0 -52
- data/spec/models/job_info_spec.rb +0 -94
- data/spec/models/job_spec.rb +0 -196
- data/spec/models/level_create_spec.rb +0 -64
- data/spec/models/level_edit_spec.rb +0 -46
- data/spec/models/level_info_spec.rb +0 -94
- data/spec/models/level_spec.rb +0 -184
- data/spec/models/mapping_message_info_spec.rb +0 -76
- data/spec/models/mapping_properties_spec.rb +0 -40
- data/spec/models/member_permission_spec.rb +0 -66
- data/spec/models/member_role_spec.rb +0 -82
- data/spec/models/model_create_spec.rb +0 -68
- data/spec/models/model_edit_spec.rb +0 -56
- data/spec/models/model_info_spec.rb +0 -142
- data/spec/models/model_mapping_report_spec.rb +0 -118
- data/spec/models/model_mapping_spec.rb +0 -124
- data/spec/models/model_spec.rb +0 -260
- data/spec/models/o_data_list_response_of_application_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_assembly_diagnostics_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_assembly_item_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_asset_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_attribute_definition_entity_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_attribute_definition_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_attribute_value_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_complex_value_base_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_component_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_component_type_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_contact_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_document_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_entity_ref_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_entity_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_facility_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_issue_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_job_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_level_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_member_permission_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_model_mapping_report_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_model_mapping_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_model_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_resource_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_role_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_row_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_schedule_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_site_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_space_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_spare_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_system_item_spec.rb +0 -52
- data/spec/models/o_data_list_response_of_zone_spec.rb +0 -52
- data/spec/models/o_data_response_of_boolean_spec.rb +0 -40
- data/spec/models/quota_status_spec.rb +0 -66
- data/spec/models/related_entity_spec.rb +0 -166
- data/spec/models/resource_info_spec.rb +0 -94
- data/spec/models/resource_spec.rb +0 -172
- data/spec/models/role_member_spec.rb +0 -56
- data/spec/models/role_spec.rb +0 -88
- data/spec/models/row_spec.rb +0 -40
- data/spec/models/schedule_spec.rb +0 -58
- data/spec/models/site_spec.rb +0 -166
- data/spec/models/space_create_spec.rb +0 -70
- data/spec/models/space_edit_spec.rb +0 -52
- data/spec/models/space_info_spec.rb +0 -106
- data/spec/models/space_spec.rb +0 -202
- data/spec/models/spare_create_spec.rb +0 -70
- data/spec/models/spare_edit_spec.rb +0 -52
- data/spec/models/spare_info_spec.rb +0 -94
- data/spec/models/spare_spec.rb +0 -178
- data/spec/models/system_info_spec.rb +0 -100
- data/spec/models/system_item_spec.rb +0 -178
- data/spec/models/user_permissions_spec.rb +0 -56
- data/spec/models/value_container_spec.rb +0 -78
- data/spec/models/zone_info_spec.rb +0 -94
- data/spec/models/zone_spec.rb +0 -178
- data/spec/spec_helper.rb +0 -111
- data/xbim_aim-1.0.0.gem +0 -0
- data/xbim_aim.gemspec +0 -38
@@ -1,288 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#XBIM Flex API v2
|
3
|
-
|
4
|
-
#This is the XBIM Flex Swagger service where you can explore the REST API for the platform.
|
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 XbimAim
|
17
|
-
class AttributeDefinitionEdit
|
18
|
-
attr_accessor :name
|
19
|
-
|
20
|
-
attr_accessor :group_name
|
21
|
-
|
22
|
-
attr_accessor :group_type
|
23
|
-
|
24
|
-
attr_accessor :semantic_type
|
25
|
-
|
26
|
-
attr_accessor :unit
|
27
|
-
|
28
|
-
class EnumAttributeValidator
|
29
|
-
attr_reader :datatype
|
30
|
-
attr_reader :allowable_values
|
31
|
-
|
32
|
-
def initialize(datatype, allowable_values)
|
33
|
-
@allowable_values = allowable_values.map do |value|
|
34
|
-
case datatype.to_s
|
35
|
-
when /Integer/i
|
36
|
-
value.to_i
|
37
|
-
when /Float/i
|
38
|
-
value.to_f
|
39
|
-
else
|
40
|
-
value
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def valid?(value)
|
46
|
-
!value || allowable_values.include?(value)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
-
def self.attribute_map
|
52
|
-
{
|
53
|
-
:'name' => :'Name',
|
54
|
-
:'group_name' => :'GroupName',
|
55
|
-
:'group_type' => :'GroupType',
|
56
|
-
:'semantic_type' => :'SemanticType',
|
57
|
-
:'unit' => :'Unit'
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
# Returns all the JSON keys this model knows about
|
62
|
-
def self.acceptable_attributes
|
63
|
-
attribute_map.values
|
64
|
-
end
|
65
|
-
|
66
|
-
# Attribute type mapping.
|
67
|
-
def self.openapi_types
|
68
|
-
{
|
69
|
-
:'name' => :'String',
|
70
|
-
:'group_name' => :'String',
|
71
|
-
:'group_type' => :'String',
|
72
|
-
:'semantic_type' => :'String',
|
73
|
-
:'unit' => :'String'
|
74
|
-
}
|
75
|
-
end
|
76
|
-
|
77
|
-
# List of attributes with nullable: true
|
78
|
-
def self.openapi_nullable
|
79
|
-
Set.new([
|
80
|
-
])
|
81
|
-
end
|
82
|
-
|
83
|
-
# Initializes the object
|
84
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
-
def initialize(attributes = {})
|
86
|
-
if (!attributes.is_a?(Hash))
|
87
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `XbimAim::AttributeDefinitionEdit` initialize method"
|
88
|
-
end
|
89
|
-
|
90
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
91
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
92
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
93
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `XbimAim::AttributeDefinitionEdit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
94
|
-
end
|
95
|
-
h[k.to_sym] = v
|
96
|
-
}
|
97
|
-
|
98
|
-
if attributes.key?(:'name')
|
99
|
-
self.name = attributes[:'name']
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'group_name')
|
103
|
-
self.group_name = attributes[:'group_name']
|
104
|
-
end
|
105
|
-
|
106
|
-
if attributes.key?(:'group_type')
|
107
|
-
self.group_type = attributes[:'group_type']
|
108
|
-
end
|
109
|
-
|
110
|
-
if attributes.key?(:'semantic_type')
|
111
|
-
self.semantic_type = attributes[:'semantic_type']
|
112
|
-
end
|
113
|
-
|
114
|
-
if attributes.key?(:'unit')
|
115
|
-
self.unit = attributes[:'unit']
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
120
|
-
# @return Array for valid properties with the reasons
|
121
|
-
def list_invalid_properties
|
122
|
-
invalid_properties = Array.new
|
123
|
-
invalid_properties
|
124
|
-
end
|
125
|
-
|
126
|
-
# Check to see if the all the properties in the model are valid
|
127
|
-
# @return true if the model is valid
|
128
|
-
def valid?
|
129
|
-
group_type_validator = EnumAttributeValidator.new('String', ["AimSystemAttribute", "Classification", "PsetAttribute", "UserAttribute", "QuantityAttribute", "DerivedAttribute", "RequiredAttribute", "Unknown"])
|
130
|
-
return false unless group_type_validator.valid?(@group_type)
|
131
|
-
true
|
132
|
-
end
|
133
|
-
|
134
|
-
# Custom attribute writer method checking allowed values (enum).
|
135
|
-
# @param [Object] group_type Object to be assigned
|
136
|
-
def group_type=(group_type)
|
137
|
-
validator = EnumAttributeValidator.new('String', ["AimSystemAttribute", "Classification", "PsetAttribute", "UserAttribute", "QuantityAttribute", "DerivedAttribute", "RequiredAttribute", "Unknown"])
|
138
|
-
unless validator.valid?(group_type)
|
139
|
-
fail ArgumentError, "invalid value for \"group_type\", must be one of #{validator.allowable_values}."
|
140
|
-
end
|
141
|
-
@group_type = group_type
|
142
|
-
end
|
143
|
-
|
144
|
-
# Checks equality by comparing each attribute.
|
145
|
-
# @param [Object] Object to be compared
|
146
|
-
def ==(o)
|
147
|
-
return true if self.equal?(o)
|
148
|
-
self.class == o.class &&
|
149
|
-
name == o.name &&
|
150
|
-
group_name == o.group_name &&
|
151
|
-
group_type == o.group_type &&
|
152
|
-
semantic_type == o.semantic_type &&
|
153
|
-
unit == o.unit
|
154
|
-
end
|
155
|
-
|
156
|
-
# @see the `==` method
|
157
|
-
# @param [Object] Object to be compared
|
158
|
-
def eql?(o)
|
159
|
-
self == o
|
160
|
-
end
|
161
|
-
|
162
|
-
# Calculates hash code according to all attributes.
|
163
|
-
# @return [Integer] Hash code
|
164
|
-
def hash
|
165
|
-
[name, group_name, group_type, semantic_type, unit].hash
|
166
|
-
end
|
167
|
-
|
168
|
-
# Builds the object from hash
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
# @return [Object] Returns the model itself
|
171
|
-
def self.build_from_hash(attributes)
|
172
|
-
new.build_from_hash(attributes)
|
173
|
-
end
|
174
|
-
|
175
|
-
# Builds the object from hash
|
176
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
-
# @return [Object] Returns the model itself
|
178
|
-
def build_from_hash(attributes)
|
179
|
-
return nil unless attributes.is_a?(Hash)
|
180
|
-
self.class.openapi_types.each_pair do |key, type|
|
181
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
182
|
-
self.send("#{key}=", nil)
|
183
|
-
elsif type =~ /\AArray<(.*)>/i
|
184
|
-
# check to ensure the input is an array given that the attribute
|
185
|
-
# is documented as an array but the input is not
|
186
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
187
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
188
|
-
end
|
189
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
190
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
self
|
195
|
-
end
|
196
|
-
|
197
|
-
# Deserializes the data based on type
|
198
|
-
# @param string type Data type
|
199
|
-
# @param string value Value to be deserialized
|
200
|
-
# @return [Object] Deserialized data
|
201
|
-
def _deserialize(type, value)
|
202
|
-
case type.to_sym
|
203
|
-
when :Time
|
204
|
-
Time.parse(value)
|
205
|
-
when :Date
|
206
|
-
Date.parse(value)
|
207
|
-
when :String
|
208
|
-
value.to_s
|
209
|
-
when :Integer
|
210
|
-
value.to_i
|
211
|
-
when :Float
|
212
|
-
value.to_f
|
213
|
-
when :Boolean
|
214
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
215
|
-
true
|
216
|
-
else
|
217
|
-
false
|
218
|
-
end
|
219
|
-
when :Object
|
220
|
-
# generic object (usually a Hash), return directly
|
221
|
-
value
|
222
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
223
|
-
inner_type = Regexp.last_match[:inner_type]
|
224
|
-
value.map { |v| _deserialize(inner_type, v) }
|
225
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
226
|
-
k_type = Regexp.last_match[:k_type]
|
227
|
-
v_type = Regexp.last_match[:v_type]
|
228
|
-
{}.tap do |hash|
|
229
|
-
value.each do |k, v|
|
230
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
231
|
-
end
|
232
|
-
end
|
233
|
-
else # model
|
234
|
-
# models (e.g. Pet) or oneOf
|
235
|
-
klass = XbimAim.const_get(type)
|
236
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
# Returns the string representation of the object
|
241
|
-
# @return [String] String presentation of the object
|
242
|
-
def to_s
|
243
|
-
to_hash.to_s
|
244
|
-
end
|
245
|
-
|
246
|
-
# to_body is an alias to to_hash (backward compatibility)
|
247
|
-
# @return [Hash] Returns the object in the form of hash
|
248
|
-
def to_body
|
249
|
-
to_hash
|
250
|
-
end
|
251
|
-
|
252
|
-
# Returns the object in the form of hash
|
253
|
-
# @return [Hash] Returns the object in the form of hash
|
254
|
-
def to_hash
|
255
|
-
hash = {}
|
256
|
-
self.class.attribute_map.each_pair do |attr, param|
|
257
|
-
value = self.send(attr)
|
258
|
-
if value.nil?
|
259
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
260
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
261
|
-
end
|
262
|
-
|
263
|
-
hash[param] = _to_hash(value)
|
264
|
-
end
|
265
|
-
hash
|
266
|
-
end
|
267
|
-
|
268
|
-
# Outputs non-array value in the form of hash
|
269
|
-
# For object, use to_hash. Otherwise, just return the value
|
270
|
-
# @param [Object] value Any valid value
|
271
|
-
# @return [Hash] Returns the value in the form of hash
|
272
|
-
def _to_hash(value)
|
273
|
-
if value.is_a?(Array)
|
274
|
-
value.compact.map { |v| _to_hash(v) }
|
275
|
-
elsif value.is_a?(Hash)
|
276
|
-
{}.tap do |hash|
|
277
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
278
|
-
end
|
279
|
-
elsif value.respond_to? :to_hash
|
280
|
-
value.to_hash
|
281
|
-
else
|
282
|
-
value
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
end
|
287
|
-
|
288
|
-
end
|
@@ -1,392 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#XBIM Flex API v2
|
3
|
-
|
4
|
-
#This is the XBIM Flex Swagger service where you can explore the REST API for the platform.
|
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 XbimAim
|
17
|
-
class AttributeDefinitionEntity
|
18
|
-
attr_accessor :full_name
|
19
|
-
|
20
|
-
attr_accessor :asset_model_id
|
21
|
-
|
22
|
-
attr_accessor :attribute_definition_id
|
23
|
-
|
24
|
-
attr_accessor :model
|
25
|
-
|
26
|
-
attr_accessor :values
|
27
|
-
|
28
|
-
attr_accessor :group_name
|
29
|
-
|
30
|
-
attr_accessor :group_type
|
31
|
-
|
32
|
-
attr_accessor :name
|
33
|
-
|
34
|
-
attr_accessor :canonical_name
|
35
|
-
|
36
|
-
attr_accessor :imported
|
37
|
-
|
38
|
-
attr_accessor :semantic_type
|
39
|
-
|
40
|
-
attr_accessor :unit
|
41
|
-
|
42
|
-
attr_accessor :data_type
|
43
|
-
|
44
|
-
attr_accessor :date_created
|
45
|
-
|
46
|
-
attr_accessor :date_modified
|
47
|
-
|
48
|
-
class EnumAttributeValidator
|
49
|
-
attr_reader :datatype
|
50
|
-
attr_reader :allowable_values
|
51
|
-
|
52
|
-
def initialize(datatype, allowable_values)
|
53
|
-
@allowable_values = allowable_values.map do |value|
|
54
|
-
case datatype.to_s
|
55
|
-
when /Integer/i
|
56
|
-
value.to_i
|
57
|
-
when /Float/i
|
58
|
-
value.to_f
|
59
|
-
else
|
60
|
-
value
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def valid?(value)
|
66
|
-
!value || allowable_values.include?(value)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
-
def self.attribute_map
|
72
|
-
{
|
73
|
-
:'full_name' => :'FullName',
|
74
|
-
:'asset_model_id' => :'AssetModelId',
|
75
|
-
:'attribute_definition_id' => :'AttributeDefinitionId',
|
76
|
-
:'model' => :'Model',
|
77
|
-
:'values' => :'Values',
|
78
|
-
:'group_name' => :'GroupName',
|
79
|
-
:'group_type' => :'GroupType',
|
80
|
-
:'name' => :'Name',
|
81
|
-
:'canonical_name' => :'CanonicalName',
|
82
|
-
:'imported' => :'Imported',
|
83
|
-
:'semantic_type' => :'SemanticType',
|
84
|
-
:'unit' => :'Unit',
|
85
|
-
:'data_type' => :'DataType',
|
86
|
-
:'date_created' => :'DateCreated',
|
87
|
-
:'date_modified' => :'DateModified'
|
88
|
-
}
|
89
|
-
end
|
90
|
-
|
91
|
-
# Returns all the JSON keys this model knows about
|
92
|
-
def self.acceptable_attributes
|
93
|
-
attribute_map.values
|
94
|
-
end
|
95
|
-
|
96
|
-
# Attribute type mapping.
|
97
|
-
def self.openapi_types
|
98
|
-
{
|
99
|
-
:'full_name' => :'String',
|
100
|
-
:'asset_model_id' => :'Integer',
|
101
|
-
:'attribute_definition_id' => :'Integer',
|
102
|
-
:'model' => :'Model',
|
103
|
-
:'values' => :'Array<AttributeValueEntity>',
|
104
|
-
:'group_name' => :'String',
|
105
|
-
:'group_type' => :'String',
|
106
|
-
:'name' => :'String',
|
107
|
-
:'canonical_name' => :'String',
|
108
|
-
:'imported' => :'Boolean',
|
109
|
-
:'semantic_type' => :'String',
|
110
|
-
:'unit' => :'String',
|
111
|
-
:'data_type' => :'String',
|
112
|
-
:'date_created' => :'Time',
|
113
|
-
:'date_modified' => :'Time'
|
114
|
-
}
|
115
|
-
end
|
116
|
-
|
117
|
-
# List of attributes with nullable: true
|
118
|
-
def self.openapi_nullable
|
119
|
-
Set.new([
|
120
|
-
])
|
121
|
-
end
|
122
|
-
|
123
|
-
# Initializes the object
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
def initialize(attributes = {})
|
126
|
-
if (!attributes.is_a?(Hash))
|
127
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `XbimAim::AttributeDefinitionEntity` initialize method"
|
128
|
-
end
|
129
|
-
|
130
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
131
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
132
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
133
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `XbimAim::AttributeDefinitionEntity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
134
|
-
end
|
135
|
-
h[k.to_sym] = v
|
136
|
-
}
|
137
|
-
|
138
|
-
if attributes.key?(:'full_name')
|
139
|
-
self.full_name = attributes[:'full_name']
|
140
|
-
end
|
141
|
-
|
142
|
-
if attributes.key?(:'asset_model_id')
|
143
|
-
self.asset_model_id = attributes[:'asset_model_id']
|
144
|
-
end
|
145
|
-
|
146
|
-
if attributes.key?(:'attribute_definition_id')
|
147
|
-
self.attribute_definition_id = attributes[:'attribute_definition_id']
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.key?(:'model')
|
151
|
-
self.model = attributes[:'model']
|
152
|
-
end
|
153
|
-
|
154
|
-
if attributes.key?(:'values')
|
155
|
-
if (value = attributes[:'values']).is_a?(Array)
|
156
|
-
self.values = value
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
if attributes.key?(:'group_name')
|
161
|
-
self.group_name = attributes[:'group_name']
|
162
|
-
end
|
163
|
-
|
164
|
-
if attributes.key?(:'group_type')
|
165
|
-
self.group_type = attributes[:'group_type']
|
166
|
-
end
|
167
|
-
|
168
|
-
if attributes.key?(:'name')
|
169
|
-
self.name = attributes[:'name']
|
170
|
-
end
|
171
|
-
|
172
|
-
if attributes.key?(:'canonical_name')
|
173
|
-
self.canonical_name = attributes[:'canonical_name']
|
174
|
-
end
|
175
|
-
|
176
|
-
if attributes.key?(:'imported')
|
177
|
-
self.imported = attributes[:'imported']
|
178
|
-
end
|
179
|
-
|
180
|
-
if attributes.key?(:'semantic_type')
|
181
|
-
self.semantic_type = attributes[:'semantic_type']
|
182
|
-
end
|
183
|
-
|
184
|
-
if attributes.key?(:'unit')
|
185
|
-
self.unit = attributes[:'unit']
|
186
|
-
end
|
187
|
-
|
188
|
-
if attributes.key?(:'data_type')
|
189
|
-
self.data_type = attributes[:'data_type']
|
190
|
-
end
|
191
|
-
|
192
|
-
if attributes.key?(:'date_created')
|
193
|
-
self.date_created = attributes[:'date_created']
|
194
|
-
end
|
195
|
-
|
196
|
-
if attributes.key?(:'date_modified')
|
197
|
-
self.date_modified = attributes[:'date_modified']
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
202
|
-
# @return Array for valid properties with the reasons
|
203
|
-
def list_invalid_properties
|
204
|
-
invalid_properties = Array.new
|
205
|
-
invalid_properties
|
206
|
-
end
|
207
|
-
|
208
|
-
# Check to see if the all the properties in the model are valid
|
209
|
-
# @return true if the model is valid
|
210
|
-
def valid?
|
211
|
-
group_type_validator = EnumAttributeValidator.new('String', ["AimSystemAttribute", "Classification", "PsetAttribute", "UserAttribute", "QuantityAttribute", "DerivedAttribute", "RequiredAttribute", "Unknown"])
|
212
|
-
return false unless group_type_validator.valid?(@group_type)
|
213
|
-
data_type_validator = EnumAttributeValidator.new('String', ["Undefined", "NotNull", "Date", "Integer", "Real", "Logical", "Text"])
|
214
|
-
return false unless data_type_validator.valid?(@data_type)
|
215
|
-
true
|
216
|
-
end
|
217
|
-
|
218
|
-
# Custom attribute writer method checking allowed values (enum).
|
219
|
-
# @param [Object] group_type Object to be assigned
|
220
|
-
def group_type=(group_type)
|
221
|
-
validator = EnumAttributeValidator.new('String', ["AimSystemAttribute", "Classification", "PsetAttribute", "UserAttribute", "QuantityAttribute", "DerivedAttribute", "RequiredAttribute", "Unknown"])
|
222
|
-
unless validator.valid?(group_type)
|
223
|
-
fail ArgumentError, "invalid value for \"group_type\", must be one of #{validator.allowable_values}."
|
224
|
-
end
|
225
|
-
@group_type = group_type
|
226
|
-
end
|
227
|
-
|
228
|
-
# Custom attribute writer method checking allowed values (enum).
|
229
|
-
# @param [Object] data_type Object to be assigned
|
230
|
-
def data_type=(data_type)
|
231
|
-
validator = EnumAttributeValidator.new('String', ["Undefined", "NotNull", "Date", "Integer", "Real", "Logical", "Text"])
|
232
|
-
unless validator.valid?(data_type)
|
233
|
-
fail ArgumentError, "invalid value for \"data_type\", must be one of #{validator.allowable_values}."
|
234
|
-
end
|
235
|
-
@data_type = data_type
|
236
|
-
end
|
237
|
-
|
238
|
-
# Checks equality by comparing each attribute.
|
239
|
-
# @param [Object] Object to be compared
|
240
|
-
def ==(o)
|
241
|
-
return true if self.equal?(o)
|
242
|
-
self.class == o.class &&
|
243
|
-
full_name == o.full_name &&
|
244
|
-
asset_model_id == o.asset_model_id &&
|
245
|
-
attribute_definition_id == o.attribute_definition_id &&
|
246
|
-
model == o.model &&
|
247
|
-
values == o.values &&
|
248
|
-
group_name == o.group_name &&
|
249
|
-
group_type == o.group_type &&
|
250
|
-
name == o.name &&
|
251
|
-
canonical_name == o.canonical_name &&
|
252
|
-
imported == o.imported &&
|
253
|
-
semantic_type == o.semantic_type &&
|
254
|
-
unit == o.unit &&
|
255
|
-
data_type == o.data_type &&
|
256
|
-
date_created == o.date_created &&
|
257
|
-
date_modified == o.date_modified
|
258
|
-
end
|
259
|
-
|
260
|
-
# @see the `==` method
|
261
|
-
# @param [Object] Object to be compared
|
262
|
-
def eql?(o)
|
263
|
-
self == o
|
264
|
-
end
|
265
|
-
|
266
|
-
# Calculates hash code according to all attributes.
|
267
|
-
# @return [Integer] Hash code
|
268
|
-
def hash
|
269
|
-
[full_name, asset_model_id, attribute_definition_id, model, values, group_name, group_type, name, canonical_name, imported, semantic_type, unit, data_type, date_created, date_modified].hash
|
270
|
-
end
|
271
|
-
|
272
|
-
# Builds the object from hash
|
273
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
274
|
-
# @return [Object] Returns the model itself
|
275
|
-
def self.build_from_hash(attributes)
|
276
|
-
new.build_from_hash(attributes)
|
277
|
-
end
|
278
|
-
|
279
|
-
# Builds the object from hash
|
280
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
281
|
-
# @return [Object] Returns the model itself
|
282
|
-
def build_from_hash(attributes)
|
283
|
-
return nil unless attributes.is_a?(Hash)
|
284
|
-
self.class.openapi_types.each_pair do |key, type|
|
285
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
286
|
-
self.send("#{key}=", nil)
|
287
|
-
elsif type =~ /\AArray<(.*)>/i
|
288
|
-
# check to ensure the input is an array given that the attribute
|
289
|
-
# is documented as an array but the input is not
|
290
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
291
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
292
|
-
end
|
293
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
294
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
self
|
299
|
-
end
|
300
|
-
|
301
|
-
# Deserializes the data based on type
|
302
|
-
# @param string type Data type
|
303
|
-
# @param string value Value to be deserialized
|
304
|
-
# @return [Object] Deserialized data
|
305
|
-
def _deserialize(type, value)
|
306
|
-
case type.to_sym
|
307
|
-
when :Time
|
308
|
-
Time.parse(value)
|
309
|
-
when :Date
|
310
|
-
Date.parse(value)
|
311
|
-
when :String
|
312
|
-
value.to_s
|
313
|
-
when :Integer
|
314
|
-
value.to_i
|
315
|
-
when :Float
|
316
|
-
value.to_f
|
317
|
-
when :Boolean
|
318
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
319
|
-
true
|
320
|
-
else
|
321
|
-
false
|
322
|
-
end
|
323
|
-
when :Object
|
324
|
-
# generic object (usually a Hash), return directly
|
325
|
-
value
|
326
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
327
|
-
inner_type = Regexp.last_match[:inner_type]
|
328
|
-
value.map { |v| _deserialize(inner_type, v) }
|
329
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
330
|
-
k_type = Regexp.last_match[:k_type]
|
331
|
-
v_type = Regexp.last_match[:v_type]
|
332
|
-
{}.tap do |hash|
|
333
|
-
value.each do |k, v|
|
334
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
335
|
-
end
|
336
|
-
end
|
337
|
-
else # model
|
338
|
-
# models (e.g. Pet) or oneOf
|
339
|
-
klass = XbimAim.const_get(type)
|
340
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
|
-
# Returns the string representation of the object
|
345
|
-
# @return [String] String presentation of the object
|
346
|
-
def to_s
|
347
|
-
to_hash.to_s
|
348
|
-
end
|
349
|
-
|
350
|
-
# to_body is an alias to to_hash (backward compatibility)
|
351
|
-
# @return [Hash] Returns the object in the form of hash
|
352
|
-
def to_body
|
353
|
-
to_hash
|
354
|
-
end
|
355
|
-
|
356
|
-
# Returns the object in the form of hash
|
357
|
-
# @return [Hash] Returns the object in the form of hash
|
358
|
-
def to_hash
|
359
|
-
hash = {}
|
360
|
-
self.class.attribute_map.each_pair do |attr, param|
|
361
|
-
value = self.send(attr)
|
362
|
-
if value.nil?
|
363
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
364
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
365
|
-
end
|
366
|
-
|
367
|
-
hash[param] = _to_hash(value)
|
368
|
-
end
|
369
|
-
hash
|
370
|
-
end
|
371
|
-
|
372
|
-
# Outputs non-array value in the form of hash
|
373
|
-
# For object, use to_hash. Otherwise, just return the value
|
374
|
-
# @param [Object] value Any valid value
|
375
|
-
# @return [Hash] Returns the value in the form of hash
|
376
|
-
def _to_hash(value)
|
377
|
-
if value.is_a?(Array)
|
378
|
-
value.compact.map { |v| _to_hash(v) }
|
379
|
-
elsif value.is_a?(Hash)
|
380
|
-
{}.tap do |hash|
|
381
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
382
|
-
end
|
383
|
-
elsif value.respond_to? :to_hash
|
384
|
-
value.to_hash
|
385
|
-
else
|
386
|
-
value
|
387
|
-
end
|
388
|
-
end
|
389
|
-
|
390
|
-
end
|
391
|
-
|
392
|
-
end
|