katapult-ruby 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +73 -143
- data/lib/katapult-ruby/api/core_api.rb +705 -653
- data/lib/katapult-ruby/configuration.rb +3 -3
- data/lib/katapult-ruby/models/{delete_virtual_machine_part_data_center.rb → address_list.rb} +20 -16
- data/lib/katapult-ruby/models/{model_alias.rb → address_list_arguments.rb} +5 -3
- data/lib/katapult-ruby/models/{get_disk_part_operating_system.rb → address_list_entry.rb} +15 -4
- data/lib/katapult-ruby/models/{ns.rb → address_list_entry_arguments.rb} +16 -4
- data/lib/katapult-ruby/models/{aaaa.rb → address_list_entry_lookup.rb} +11 -10
- data/lib/katapult-ruby/models/{dns_zone_already_verified_enum.rb → address_list_entry_not_found_enum.rb} +5 -5
- data/lib/katapult-ruby/models/{a.rb → address_list_lookup.rb} +11 -10
- data/lib/katapult-ruby/models/{property_type_enum.rb → address_list_not_found_enum.rb} +5 -7
- data/lib/katapult-ruby/models/certificate.rb +8 -0
- data/lib/katapult-ruby/models/country.rb +1 -0
- data/lib/katapult-ruby/models/data_center.rb +1 -0
- data/lib/katapult-ruby/models/{dns_zone_not_verified.rb → decimal_or_unlimited.rb} +20 -10
- data/lib/katapult-ruby/models/{patch_load_balancer_part_weights.rb → delete_address_list200_response.rb} +17 -19
- data/lib/katapult-ruby/models/{get_dns_records_dns_record200_response.rb → delete_address_list_entry200_response.rb} +14 -14
- data/lib/katapult-ruby/models/{delete_dns_zones_dns_zone200_response.rb → delete_address_list_entry_request.rb} +14 -14
- data/lib/katapult-ruby/models/{get_disk_template_part_badge.rb → delete_address_list_request.rb} +17 -10
- data/lib/katapult-ruby/models/delete_disk_backup_policy_schedule200_response_disk_backup_policy.rb +1 -0
- data/lib/katapult-ruby/models/{delete_dns_records_dns_record_request.rb → delete_dns_record_request.rb} +3 -3
- data/lib/katapult-ruby/models/{delete_dns_zones_dns_zone_request.rb → delete_dns_zone_request.rb} +3 -3
- data/lib/katapult-ruby/models/delete_file_storage_volume200_response_file_storage_volume.rb +2 -0
- data/lib/katapult-ruby/models/delete_file_storage_volume_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/delete_load_balancer200_response_load_balancer.rb +1 -0
- data/lib/katapult-ruby/models/delete_virtual_machine200_response_virtual_machine.rb +27 -9
- data/lib/katapult-ruby/models/disk.rb +3 -0
- data/lib/katapult-ruby/models/disk_installation_attribute.rb +2 -0
- data/lib/katapult-ruby/models/disk_io_profile.rb +2 -0
- data/lib/katapult-ruby/models/disk_template.rb +3 -0
- data/lib/katapult-ruby/models/dns_record.rb +3 -0
- data/lib/katapult-ruby/models/dns_record_arguments.rb +24 -14
- data/lib/katapult-ruby/models/{get_virtual_machine_part_gpus.rb → dns_record_content_arguments.rb} +115 -55
- data/lib/katapult-ruby/models/{get_dns_zones_dns_zone200_response.rb → dns_record_content_arguments_for_a.rb} +11 -17
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_aaaa.rb +215 -0
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_alias.rb +215 -0
- data/lib/katapult-ruby/models/{delete_virtual_machine_part_operating_system.rb → dns_record_content_arguments_for_caa.rb} +23 -22
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_cname.rb +215 -0
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_ips.rb +215 -0
- data/lib/katapult-ruby/models/{cname.rb → dns_record_content_arguments_for_mx.rb} +11 -10
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_ns.rb +215 -0
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_ptr.rb +215 -0
- data/lib/katapult-ruby/models/{srv.rb → dns_record_content_arguments_for_srv.rb} +5 -13
- data/lib/katapult-ruby/models/{sshfp.rb → dns_record_content_arguments_for_sshfp.rb} +4 -3
- data/lib/katapult-ruby/models/{dns_record_properties.rb → dns_record_content_arguments_for_txt.rb} +11 -10
- data/lib/katapult-ruby/models/dns_record_content_arguments_for_virtual_machine.rb +215 -0
- data/lib/katapult-ruby/models/dns_record_content_attributes.rb +14 -0
- data/lib/katapult-ruby/models/dns_zone.rb +10 -19
- data/lib/katapult-ruby/models/dns_zone_arguments.rb +9 -15
- data/lib/katapult-ruby/models/{get_dns_zones_dns_zone_verification_details422_response.rb → get_address_list404_response.rb} +4 -4
- data/lib/katapult-ruby/models/{delete_virtual_machine_part_currency.rb → get_address_list_entries200_response.rb} +33 -34
- data/lib/katapult-ruby/models/get_address_list_entry404_response.rb +254 -0
- data/lib/katapult-ruby/models/{dns_zone_verification_details.rb → get_address_lists200_response.rb} +35 -11
- data/lib/katapult-ruby/models/{patch_virtual_machine_part_operating_system.rb → get_address_lists200_response_address_lists.rb} +12 -10
- data/lib/katapult-ruby/models/get_data_center200_response_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_data_center_default_network200_response_network.rb +1 -0
- data/lib/katapult-ruby/models/get_data_center_default_network_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_data_centers200_response_data_centers.rb +1 -0
- data/lib/katapult-ruby/models/get_disk200_response_disk.rb +5 -2
- data/lib/katapult-ruby/models/get_disk_backup_policy200_response_disk_backup_policy.rb +2 -1
- data/lib/katapult-ruby/models/get_disk_template200_response_disk_template.rb +4 -1
- data/lib/katapult-ruby/models/{get_dns_records_dns_record404_response.rb → get_dns_record404_response.rb} +3 -3
- data/lib/katapult-ruby/models/{get_dns_zones_dns_zone404_response.rb → get_dns_zone404_response.rb} +3 -3
- data/lib/katapult-ruby/models/get_file_storage_volume200_response_file_storage_volume.rb +2 -0
- data/lib/katapult-ruby/models/get_file_storage_volume_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_gpu_type_part_data_centers.rb +1 -0
- data/lib/katapult-ruby/models/get_gpu_types_part_data_centers.rb +1 -0
- data/lib/katapult-ruby/models/get_load_balancer200_response_load_balancer.rb +4 -5
- data/lib/katapult-ruby/models/get_load_balancer_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_load_balancers_rules_load_balancer_rule200_response_load_balancer_rule.rb +2 -0
- data/lib/katapult-ruby/models/{get_organization_users_with_access_part_user.rb → get_organization_address_lists200_response.rb} +33 -34
- data/lib/katapult-ruby/models/{get_virtual_machine_part_attached_iso.rb → get_organization_address_lists200_response_address_lists.rb} +12 -10
- data/lib/katapult-ruby/models/get_organization_available_networks200_response_networks.rb +1 -0
- data/lib/katapult-ruby/models/get_organization_available_networks_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_organization_certificates200_response_certificates.rb +2 -0
- data/lib/katapult-ruby/models/get_organization_disk_templates200_response_disk_templates.rb +3 -0
- data/lib/katapult-ruby/models/get_organization_disks200_response_disk.rb +1 -0
- data/lib/katapult-ruby/models/get_organization_file_storage_volumes200_response_file_storage_volumes.rb +2 -0
- data/lib/katapult-ruby/models/get_organization_file_storage_volumes_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/get_organization_ip_addresses200_response_ip_addresses.rb +2 -0
- data/lib/katapult-ruby/models/get_organization_load_balancers200_response_load_balancers.rb +3 -4
- data/lib/katapult-ruby/models/{delete_dns_records_dns_record200_response.rb → get_organization_policy_limits200_response.rb} +14 -14
- data/lib/katapult-ruby/models/get_organization_users_with_access200_response_users.rb +2 -1
- data/lib/katapult-ruby/models/get_organization_virtual_machines200_response_virtual_machines.rb +3 -1
- data/lib/katapult-ruby/models/get_security_group_rules200_response_security_group_rules.rb +2 -0
- data/lib/katapult-ruby/models/get_security_groups_rules_security_group_rule200_response_security_group_rule.rb +2 -0
- data/lib/katapult-ruby/models/get_virtual_machine200_response_virtual_machine.rb +27 -9
- data/lib/katapult-ruby/models/get_virtual_machine_authorized_keys404_response.rb +254 -0
- data/lib/katapult-ruby/models/get_virtual_machine_packages200_response_virtual_machine_packages.rb +1 -0
- data/lib/katapult-ruby/models/get_virtual_machines_builds_virtual_machine_build200_response_virtual_machine_build.rb +1 -0
- data/lib/katapult-ruby/models/get_zones200_response_zones.rb +1 -0
- data/lib/katapult-ruby/models/get_zones_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/{mx.rb → integer_or_unlimited.rb} +17 -16
- data/lib/katapult-ruby/models/invalid_api_token.rb +1 -0
- data/lib/katapult-ruby/models/ip_address.rb +3 -0
- data/lib/katapult-ruby/models/iso.rb +1 -0
- data/lib/katapult-ruby/models/{get_load_balancer_part_weights.rb → load_balancer_weight.rb} +3 -3
- data/lib/katapult-ruby/models/network.rb +1 -0
- data/lib/katapult-ruby/models/network_speed_profile.rb +2 -0
- data/lib/katapult-ruby/models/{infrastructure_dns_zone_cannot_be_edited_enum.rb → no_virtual_machine_for_api_token_enum.rb} +5 -5
- data/lib/katapult-ruby/models/object_in_trash.rb +1 -0
- data/lib/katapult-ruby/models/operating_system.rb +1 -0
- data/lib/katapult-ruby/models/organization.rb +10 -0
- data/lib/katapult-ruby/models/organization_policy.rb +349 -0
- data/lib/katapult-ruby/models/pagination_object.rb +2 -0
- data/lib/katapult-ruby/models/{delete_virtual_machine_part_zone.rb → patch_address_list_entry_request.rb} +30 -34
- data/lib/katapult-ruby/models/{get_disk_part_disk_template.rb → patch_address_list_request.rb} +30 -34
- data/lib/katapult-ruby/models/patch_file_storage_volume200_response_file_storage_volume.rb +2 -0
- data/lib/katapult-ruby/models/patch_file_storage_volume_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/patch_load_balancer200_response_load_balancer.rb +4 -5
- data/lib/katapult-ruby/models/patch_load_balancer_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/patch_load_balancers_rules_load_balancer_rule200_response_load_balancer_rule.rb +2 -0
- data/lib/katapult-ruby/models/patch_security_groups_rules_security_group_rule200_response_security_group_rule.rb +2 -0
- data/lib/katapult-ruby/models/patch_virtual_machine200_response_virtual_machine.rb +27 -9
- data/lib/katapult-ruby/models/permission_denied.rb +1 -0
- data/lib/katapult-ruby/models/post_address_list_entries201_response.rb +221 -0
- data/lib/katapult-ruby/models/{get_virtual_machine_part_currency.rb → post_address_list_entries_request.rb} +30 -34
- data/lib/katapult-ruby/models/post_disk_disk_backup_policies200_response_disk_backup_policy.rb +2 -1
- data/lib/katapult-ruby/models/{post_dns_zones_dns_zone_verify422_response.rb → post_dns_zone_verify422_response.rb} +4 -4
- data/lib/katapult-ruby/models/post_load_balancer_rules200_response_load_balancer_rule.rb +2 -0
- data/lib/katapult-ruby/models/{post_dns_zones_dns_zone_update_ttl200_response.rb → post_organization_address_lists201_response.rb} +14 -14
- data/lib/katapult-ruby/models/{post_organizations_organization_dns_zones_request.rb → post_organization_address_lists_request.rb} +4 -4
- data/lib/katapult-ruby/models/post_organization_dns_zones201_response.rb +1 -1
- data/lib/katapult-ruby/models/post_organization_dns_zones_request.rb +11 -11
- data/lib/katapult-ruby/models/post_organization_file_storage_volumes201_response_file_storage_volume.rb +2 -0
- data/lib/katapult-ruby/models/post_organization_file_storage_volumes_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/{post_organization_load_balancers200_response.rb → post_organization_load_balancers201_response.rb} +4 -4
- data/lib/katapult-ruby/models/{post_organization_load_balancers200_response_load_balancer.rb → post_organization_load_balancers201_response_load_balancer.rb} +7 -8
- data/lib/katapult-ruby/models/post_organization_load_balancers_part_data_center.rb +1 -0
- data/lib/katapult-ruby/models/post_security_group_rules200_response_security_group_rule.rb +2 -0
- data/lib/katapult-ruby/models/post_virtual_machine_disk_backup_policies200_response_disk_backup_policy.rb +2 -1
- data/lib/katapult-ruby/models/record_content_attributes_for_a.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_aaaa.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_alias.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_caa.rb +3 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_cname.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_ips.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_mx.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_ns.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_ptr.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_srv.rb +3 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_sshfp.rb +3 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_txt.rb +1 -0
- data/lib/katapult-ruby/models/record_content_attributes_for_virtual_machine.rb +1 -0
- data/lib/katapult-ruby/models/{get_disk_backup_policy_part_schedule.rb → schedule.rb} +3 -3
- data/lib/katapult-ruby/models/task.rb +2 -0
- data/lib/katapult-ruby/models/template_spec_field.rb +3 -0
- data/lib/katapult-ruby/models/virtual_machine.rb +19 -1
- data/lib/katapult-ruby/models/virtual_machine_flexible_resources.rb +13 -4
- data/lib/katapult-ruby/models/virtual_machine_gpu.rb +2 -0
- data/lib/katapult-ruby/models/virtual_machine_package.rb +15 -4
- data/lib/katapult-ruby/models/virtual_machine_state_enum.rb +2 -1
- data/lib/katapult-ruby/models/zone.rb +1 -0
- data/lib/katapult-ruby/version.rb +1 -1
- data/lib/katapult-ruby.rb +54 -125
- metadata +57 -128
- data/lib/katapult-ruby/models/caa.rb +0 -254
- data/lib/katapult-ruby/models/delete_dns_zones_dns_zone200_response_dns_zone.rb +0 -250
- data/lib/katapult-ruby/models/delete_virtual_machine_part_attached_iso.rb +0 -232
- data/lib/katapult-ruby/models/delete_virtual_machine_part_badge.rb +0 -259
- data/lib/katapult-ruby/models/delete_virtual_machine_part_country.rb +0 -259
- data/lib/katapult-ruby/models/delete_virtual_machine_part_country_state.rb +0 -241
- data/lib/katapult-ruby/models/delete_virtual_machine_part_gpus.rb +0 -274
- data/lib/katapult-ruby/models/delete_virtual_machine_part_group.rb +0 -250
- data/lib/katapult-ruby/models/delete_virtual_machine_part_icon.rb +0 -259
- data/lib/katapult-ruby/models/delete_virtual_machine_part_ip_addresses.rb +0 -286
- data/lib/katapult-ruby/models/delete_virtual_machine_part_network.rb +0 -241
- data/lib/katapult-ruby/models/delete_virtual_machine_part_organization.rb +0 -367
- data/lib/katapult-ruby/models/delete_virtual_machine_part_package.rb +0 -317
- data/lib/katapult-ruby/models/delete_virtual_machine_part_tags.rb +0 -263
- data/lib/katapult-ruby/models/delete_virtual_machine_part_type.rb +0 -259
- data/lib/katapult-ruby/models/dns_record_properties_arguments.rb +0 -363
- data/lib/katapult-ruby/models/dns_record_properties_properties.rb +0 -114
- data/lib/katapult-ruby/models/dns_record_type_enum.rb +0 -49
- data/lib/katapult-ruby/models/get_disk_part_attributes.rb +0 -250
- data/lib/katapult-ruby/models/get_disk_part_disk_template_version.rb +0 -232
- data/lib/katapult-ruby/models/get_disk_part_installation.rb +0 -234
- data/lib/katapult-ruby/models/get_disk_part_io_profile.rb +0 -250
- data/lib/katapult-ruby/models/get_disk_template_part_operating_system.rb +0 -232
- data/lib/katapult-ruby/models/get_dns_records_dns_record200_response_dns_record.rb +0 -272
- data/lib/katapult-ruby/models/get_dns_zones_dns_zone_records200_response.rb +0 -224
- data/lib/katapult-ruby/models/get_dns_zones_dns_zone_records200_response_dns_records.rb +0 -272
- data/lib/katapult-ruby/models/get_dns_zones_dns_zone_verification_details200_response.rb +0 -221
- data/lib/katapult-ruby/models/get_organization_virtual_machines_part_data_center.rb +0 -232
- data/lib/katapult-ruby/models/get_organization_virtual_machines_part_zone.rb +0 -241
- data/lib/katapult-ruby/models/get_virtual_machine_part_badge.rb +0 -259
- data/lib/katapult-ruby/models/get_virtual_machine_part_country.rb +0 -259
- data/lib/katapult-ruby/models/get_virtual_machine_part_country_state.rb +0 -241
- data/lib/katapult-ruby/models/get_virtual_machine_part_data_center.rb +0 -241
- data/lib/katapult-ruby/models/get_virtual_machine_part_group.rb +0 -250
- data/lib/katapult-ruby/models/get_virtual_machine_part_icon.rb +0 -259
- data/lib/katapult-ruby/models/get_virtual_machine_part_ip_addresses.rb +0 -286
- data/lib/katapult-ruby/models/get_virtual_machine_part_network.rb +0 -241
- data/lib/katapult-ruby/models/get_virtual_machine_part_operating_system.rb +0 -232
- data/lib/katapult-ruby/models/get_virtual_machine_part_organization.rb +0 -367
- data/lib/katapult-ruby/models/get_virtual_machine_part_package.rb +0 -317
- data/lib/katapult-ruby/models/get_virtual_machine_part_tags.rb +0 -263
- data/lib/katapult-ruby/models/get_virtual_machine_part_type.rb +0 -259
- data/lib/katapult-ruby/models/get_virtual_machine_part_zone.rb +0 -241
- data/lib/katapult-ruby/models/infrastructure_dns_zone_cannot_be_edited_schema.rb +0 -255
- data/lib/katapult-ruby/models/one_of_infrastructure_dns_zone_cannot_be_edited403_res.rb +0 -107
- data/lib/katapult-ruby/models/patch_dns_records_dns_record200_response.rb +0 -221
- data/lib/katapult-ruby/models/patch_dns_records_dns_record200_response_dns_record.rb +0 -272
- data/lib/katapult-ruby/models/patch_dns_records_dns_record_request.rb +0 -237
- data/lib/katapult-ruby/models/patch_virtual_machine_part_attached_iso.rb +0 -232
- data/lib/katapult-ruby/models/patch_virtual_machine_part_badge.rb +0 -259
- data/lib/katapult-ruby/models/patch_virtual_machine_part_country.rb +0 -259
- data/lib/katapult-ruby/models/patch_virtual_machine_part_country_state.rb +0 -241
- data/lib/katapult-ruby/models/patch_virtual_machine_part_currency.rb +0 -241
- data/lib/katapult-ruby/models/patch_virtual_machine_part_data_center.rb +0 -241
- data/lib/katapult-ruby/models/patch_virtual_machine_part_gpus.rb +0 -274
- data/lib/katapult-ruby/models/patch_virtual_machine_part_group.rb +0 -250
- data/lib/katapult-ruby/models/patch_virtual_machine_part_icon.rb +0 -259
- data/lib/katapult-ruby/models/patch_virtual_machine_part_ip_addresses.rb +0 -286
- data/lib/katapult-ruby/models/patch_virtual_machine_part_network.rb +0 -241
- data/lib/katapult-ruby/models/patch_virtual_machine_part_organization.rb +0 -367
- data/lib/katapult-ruby/models/patch_virtual_machine_part_package.rb +0 -317
- data/lib/katapult-ruby/models/patch_virtual_machine_part_tags.rb +0 -263
- data/lib/katapult-ruby/models/patch_virtual_machine_part_type.rb +0 -259
- data/lib/katapult-ruby/models/patch_virtual_machine_part_zone.rb +0 -241
- data/lib/katapult-ruby/models/post_disk_disk_backup_policies_part_schedule.rb +0 -272
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_records200_response.rb +0 -221
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_records200_response_dns_record.rb +0 -272
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_records_request.rb +0 -237
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_update_ttl200_response_dns_zone.rb +0 -250
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_update_ttl_request.rb +0 -238
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_verify200_response.rb +0 -221
- data/lib/katapult-ruby/models/post_organization_dns_zones201_response_dns_zone.rb +0 -250
- data/lib/katapult-ruby/models/post_organization_load_balancers_part_weights.rb +0 -223
- data/lib/katapult-ruby/models/post_organization_managed201_response.rb +0 -221
- data/lib/katapult-ruby/models/post_organization_managed201_response_organization.rb +0 -367
- data/lib/katapult-ruby/models/post_organization_managed_part_country.rb +0 -259
- data/lib/katapult-ruby/models/post_organization_managed_part_country_state.rb +0 -241
- data/lib/katapult-ruby/models/post_organization_managed_part_currency.rb +0 -241
- data/lib/katapult-ruby/models/post_organizations_organization_dns_zones201_response.rb +0 -221
- data/lib/katapult-ruby/models/post_organizations_organization_dns_zones201_response_dns_zone.rb +0 -241
- data/lib/katapult-ruby/models/post_virtual_machine_disk_backup_policies_part_schedule.rb +0 -272
- data/lib/katapult-ruby/models/txt.rb +0 -214
@@ -1,317 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Katapult Core API
|
3
|
-
|
4
|
-
#Welcome to the documentation for the Katapult Core API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.1.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module KatapultAPI
|
17
|
-
class PatchVirtualMachinePartPackage
|
18
|
-
attr_accessor :id
|
19
|
-
|
20
|
-
attr_accessor :name
|
21
|
-
|
22
|
-
attr_accessor :permalink
|
23
|
-
|
24
|
-
attr_accessor :cpu_cores
|
25
|
-
|
26
|
-
attr_accessor :ipv4_addresses
|
27
|
-
|
28
|
-
attr_accessor :memory_in_gb
|
29
|
-
|
30
|
-
attr_accessor :storage_in_gb
|
31
|
-
|
32
|
-
attr_accessor :monthly_bandwidth_allowance_in_gb
|
33
|
-
|
34
|
-
attr_accessor :privacy
|
35
|
-
|
36
|
-
attr_accessor :icon
|
37
|
-
|
38
|
-
class EnumAttributeValidator
|
39
|
-
attr_reader :datatype
|
40
|
-
attr_reader :allowable_values
|
41
|
-
|
42
|
-
def initialize(datatype, allowable_values)
|
43
|
-
@allowable_values = allowable_values.map do |value|
|
44
|
-
case datatype.to_s
|
45
|
-
when /Integer/i
|
46
|
-
value.to_i
|
47
|
-
when /Float/i
|
48
|
-
value.to_f
|
49
|
-
else
|
50
|
-
value
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def valid?(value)
|
56
|
-
!value || allowable_values.include?(value)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
61
|
-
def self.attribute_map
|
62
|
-
{
|
63
|
-
:'id' => :'id',
|
64
|
-
:'name' => :'name',
|
65
|
-
:'permalink' => :'permalink',
|
66
|
-
:'cpu_cores' => :'cpu_cores',
|
67
|
-
:'ipv4_addresses' => :'ipv4_addresses',
|
68
|
-
:'memory_in_gb' => :'memory_in_gb',
|
69
|
-
:'storage_in_gb' => :'storage_in_gb',
|
70
|
-
:'monthly_bandwidth_allowance_in_gb' => :'monthly_bandwidth_allowance_in_gb',
|
71
|
-
:'privacy' => :'privacy',
|
72
|
-
:'icon' => :'icon'
|
73
|
-
}
|
74
|
-
end
|
75
|
-
|
76
|
-
# Returns all the JSON keys this model knows about
|
77
|
-
def self.acceptable_attributes
|
78
|
-
attribute_map.values
|
79
|
-
end
|
80
|
-
|
81
|
-
# Attribute type mapping.
|
82
|
-
def self.openapi_types
|
83
|
-
{
|
84
|
-
:'id' => :'String',
|
85
|
-
:'name' => :'String',
|
86
|
-
:'permalink' => :'String',
|
87
|
-
:'cpu_cores' => :'Integer',
|
88
|
-
:'ipv4_addresses' => :'Integer',
|
89
|
-
:'memory_in_gb' => :'Integer',
|
90
|
-
:'storage_in_gb' => :'Integer',
|
91
|
-
:'monthly_bandwidth_allowance_in_gb' => :'Integer',
|
92
|
-
:'privacy' => :'PrivacyTypesEnum',
|
93
|
-
:'icon' => :'PatchVirtualMachinePartIcon'
|
94
|
-
}
|
95
|
-
end
|
96
|
-
|
97
|
-
# List of attributes with nullable: true
|
98
|
-
def self.openapi_nullable
|
99
|
-
Set.new([
|
100
|
-
])
|
101
|
-
end
|
102
|
-
|
103
|
-
# Initializes the object
|
104
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
-
def initialize(attributes = {})
|
106
|
-
if (!attributes.is_a?(Hash))
|
107
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::PatchVirtualMachinePartPackage` initialize method"
|
108
|
-
end
|
109
|
-
|
110
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
111
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
112
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
113
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::PatchVirtualMachinePartPackage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
114
|
-
end
|
115
|
-
h[k.to_sym] = v
|
116
|
-
}
|
117
|
-
|
118
|
-
if attributes.key?(:'id')
|
119
|
-
self.id = attributes[:'id']
|
120
|
-
end
|
121
|
-
|
122
|
-
if attributes.key?(:'name')
|
123
|
-
self.name = attributes[:'name']
|
124
|
-
end
|
125
|
-
|
126
|
-
if attributes.key?(:'permalink')
|
127
|
-
self.permalink = attributes[:'permalink']
|
128
|
-
end
|
129
|
-
|
130
|
-
if attributes.key?(:'cpu_cores')
|
131
|
-
self.cpu_cores = attributes[:'cpu_cores']
|
132
|
-
end
|
133
|
-
|
134
|
-
if attributes.key?(:'ipv4_addresses')
|
135
|
-
self.ipv4_addresses = attributes[:'ipv4_addresses']
|
136
|
-
end
|
137
|
-
|
138
|
-
if attributes.key?(:'memory_in_gb')
|
139
|
-
self.memory_in_gb = attributes[:'memory_in_gb']
|
140
|
-
end
|
141
|
-
|
142
|
-
if attributes.key?(:'storage_in_gb')
|
143
|
-
self.storage_in_gb = attributes[:'storage_in_gb']
|
144
|
-
end
|
145
|
-
|
146
|
-
if attributes.key?(:'monthly_bandwidth_allowance_in_gb')
|
147
|
-
self.monthly_bandwidth_allowance_in_gb = attributes[:'monthly_bandwidth_allowance_in_gb']
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.key?(:'privacy')
|
151
|
-
self.privacy = attributes[:'privacy']
|
152
|
-
end
|
153
|
-
|
154
|
-
if attributes.key?(:'icon')
|
155
|
-
self.icon = attributes[:'icon']
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
160
|
-
# @return Array for valid properties with the reasons
|
161
|
-
def list_invalid_properties
|
162
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
163
|
-
invalid_properties = Array.new
|
164
|
-
invalid_properties
|
165
|
-
end
|
166
|
-
|
167
|
-
# Check to see if the all the properties in the model are valid
|
168
|
-
# @return true if the model is valid
|
169
|
-
def valid?
|
170
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
171
|
-
true
|
172
|
-
end
|
173
|
-
|
174
|
-
# Checks equality by comparing each attribute.
|
175
|
-
# @param [Object] Object to be compared
|
176
|
-
def ==(o)
|
177
|
-
return true if self.equal?(o)
|
178
|
-
self.class == o.class &&
|
179
|
-
id == o.id &&
|
180
|
-
name == o.name &&
|
181
|
-
permalink == o.permalink &&
|
182
|
-
cpu_cores == o.cpu_cores &&
|
183
|
-
ipv4_addresses == o.ipv4_addresses &&
|
184
|
-
memory_in_gb == o.memory_in_gb &&
|
185
|
-
storage_in_gb == o.storage_in_gb &&
|
186
|
-
monthly_bandwidth_allowance_in_gb == o.monthly_bandwidth_allowance_in_gb &&
|
187
|
-
privacy == o.privacy &&
|
188
|
-
icon == o.icon
|
189
|
-
end
|
190
|
-
|
191
|
-
# @see the `==` method
|
192
|
-
# @param [Object] Object to be compared
|
193
|
-
def eql?(o)
|
194
|
-
self == o
|
195
|
-
end
|
196
|
-
|
197
|
-
# Calculates hash code according to all attributes.
|
198
|
-
# @return [Integer] Hash code
|
199
|
-
def hash
|
200
|
-
[id, name, permalink, cpu_cores, ipv4_addresses, memory_in_gb, storage_in_gb, monthly_bandwidth_allowance_in_gb, privacy, icon].hash
|
201
|
-
end
|
202
|
-
|
203
|
-
# Builds the object from hash
|
204
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
205
|
-
# @return [Object] Returns the model itself
|
206
|
-
def self.build_from_hash(attributes)
|
207
|
-
return nil unless attributes.is_a?(Hash)
|
208
|
-
attributes = attributes.transform_keys(&:to_sym)
|
209
|
-
transformed_hash = {}
|
210
|
-
openapi_types.each_pair do |key, type|
|
211
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
212
|
-
transformed_hash["#{key}"] = nil
|
213
|
-
elsif type =~ /\AArray<(.*)>/i
|
214
|
-
# check to ensure the input is an array given that the attribute
|
215
|
-
# is documented as an array but the input is not
|
216
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
217
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
218
|
-
end
|
219
|
-
elsif !attributes[attribute_map[key]].nil?
|
220
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
221
|
-
end
|
222
|
-
end
|
223
|
-
new(transformed_hash)
|
224
|
-
end
|
225
|
-
|
226
|
-
# Deserializes the data based on type
|
227
|
-
# @param string type Data type
|
228
|
-
# @param string value Value to be deserialized
|
229
|
-
# @return [Object] Deserialized data
|
230
|
-
def self._deserialize(type, value)
|
231
|
-
case type.to_sym
|
232
|
-
when :Time
|
233
|
-
Time.parse(value)
|
234
|
-
when :Date
|
235
|
-
Date.parse(value)
|
236
|
-
when :String
|
237
|
-
value.to_s
|
238
|
-
when :Integer
|
239
|
-
value.to_i
|
240
|
-
when :Float
|
241
|
-
value.to_f
|
242
|
-
when :Boolean
|
243
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
244
|
-
true
|
245
|
-
else
|
246
|
-
false
|
247
|
-
end
|
248
|
-
when :Object
|
249
|
-
# generic object (usually a Hash), return directly
|
250
|
-
value
|
251
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
252
|
-
inner_type = Regexp.last_match[:inner_type]
|
253
|
-
value.map { |v| _deserialize(inner_type, v) }
|
254
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
255
|
-
k_type = Regexp.last_match[:k_type]
|
256
|
-
v_type = Regexp.last_match[:v_type]
|
257
|
-
{}.tap do |hash|
|
258
|
-
value.each do |k, v|
|
259
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
260
|
-
end
|
261
|
-
end
|
262
|
-
else # model
|
263
|
-
# models (e.g. Pet) or oneOf
|
264
|
-
klass = KatapultAPI.const_get(type)
|
265
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
266
|
-
end
|
267
|
-
end
|
268
|
-
|
269
|
-
# Returns the string representation of the object
|
270
|
-
# @return [String] String presentation of the object
|
271
|
-
def to_s
|
272
|
-
to_hash.to_s
|
273
|
-
end
|
274
|
-
|
275
|
-
# to_body is an alias to to_hash (backward compatibility)
|
276
|
-
# @return [Hash] Returns the object in the form of hash
|
277
|
-
def to_body
|
278
|
-
to_hash
|
279
|
-
end
|
280
|
-
|
281
|
-
# Returns the object in the form of hash
|
282
|
-
# @return [Hash] Returns the object in the form of hash
|
283
|
-
def to_hash
|
284
|
-
hash = {}
|
285
|
-
self.class.attribute_map.each_pair do |attr, param|
|
286
|
-
value = self.send(attr)
|
287
|
-
if value.nil?
|
288
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
289
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
290
|
-
end
|
291
|
-
|
292
|
-
hash[param] = _to_hash(value)
|
293
|
-
end
|
294
|
-
hash
|
295
|
-
end
|
296
|
-
|
297
|
-
# Outputs non-array value in the form of hash
|
298
|
-
# For object, use to_hash. Otherwise, just return the value
|
299
|
-
# @param [Object] value Any valid value
|
300
|
-
# @return [Hash] Returns the value in the form of hash
|
301
|
-
def _to_hash(value)
|
302
|
-
if value.is_a?(Array)
|
303
|
-
value.compact.map { |v| _to_hash(v) }
|
304
|
-
elsif value.is_a?(Hash)
|
305
|
-
{}.tap do |hash|
|
306
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
307
|
-
end
|
308
|
-
elsif value.respond_to? :to_hash
|
309
|
-
value.to_hash
|
310
|
-
else
|
311
|
-
value
|
312
|
-
end
|
313
|
-
end
|
314
|
-
|
315
|
-
end
|
316
|
-
|
317
|
-
end
|
@@ -1,263 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Katapult Core API
|
3
|
-
|
4
|
-
#Welcome to the documentation for the Katapult Core API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.1.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module KatapultAPI
|
17
|
-
class PatchVirtualMachinePartTags
|
18
|
-
attr_accessor :id
|
19
|
-
|
20
|
-
attr_accessor :name
|
21
|
-
|
22
|
-
attr_accessor :color
|
23
|
-
|
24
|
-
attr_accessor :created_at
|
25
|
-
|
26
|
-
class EnumAttributeValidator
|
27
|
-
attr_reader :datatype
|
28
|
-
attr_reader :allowable_values
|
29
|
-
|
30
|
-
def initialize(datatype, allowable_values)
|
31
|
-
@allowable_values = allowable_values.map do |value|
|
32
|
-
case datatype.to_s
|
33
|
-
when /Integer/i
|
34
|
-
value.to_i
|
35
|
-
when /Float/i
|
36
|
-
value.to_f
|
37
|
-
else
|
38
|
-
value
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def valid?(value)
|
44
|
-
!value || allowable_values.include?(value)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
-
def self.attribute_map
|
50
|
-
{
|
51
|
-
:'id' => :'id',
|
52
|
-
:'name' => :'name',
|
53
|
-
:'color' => :'color',
|
54
|
-
:'created_at' => :'created_at'
|
55
|
-
}
|
56
|
-
end
|
57
|
-
|
58
|
-
# Returns all the JSON keys this model knows about
|
59
|
-
def self.acceptable_attributes
|
60
|
-
attribute_map.values
|
61
|
-
end
|
62
|
-
|
63
|
-
# Attribute type mapping.
|
64
|
-
def self.openapi_types
|
65
|
-
{
|
66
|
-
:'id' => :'String',
|
67
|
-
:'name' => :'String',
|
68
|
-
:'color' => :'TagColorsEnum',
|
69
|
-
:'created_at' => :'Integer'
|
70
|
-
}
|
71
|
-
end
|
72
|
-
|
73
|
-
# List of attributes with nullable: true
|
74
|
-
def self.openapi_nullable
|
75
|
-
Set.new([
|
76
|
-
])
|
77
|
-
end
|
78
|
-
|
79
|
-
# Initializes the object
|
80
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
-
def initialize(attributes = {})
|
82
|
-
if (!attributes.is_a?(Hash))
|
83
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::PatchVirtualMachinePartTags` initialize method"
|
84
|
-
end
|
85
|
-
|
86
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::PatchVirtualMachinePartTags`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
-
end
|
91
|
-
h[k.to_sym] = v
|
92
|
-
}
|
93
|
-
|
94
|
-
if attributes.key?(:'id')
|
95
|
-
self.id = attributes[:'id']
|
96
|
-
end
|
97
|
-
|
98
|
-
if attributes.key?(:'name')
|
99
|
-
self.name = attributes[:'name']
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'color')
|
103
|
-
self.color = attributes[:'color']
|
104
|
-
end
|
105
|
-
|
106
|
-
if attributes.key?(:'created_at')
|
107
|
-
self.created_at = attributes[:'created_at']
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
112
|
-
# @return Array for valid properties with the reasons
|
113
|
-
def list_invalid_properties
|
114
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
115
|
-
invalid_properties = Array.new
|
116
|
-
invalid_properties
|
117
|
-
end
|
118
|
-
|
119
|
-
# Check to see if the all the properties in the model are valid
|
120
|
-
# @return true if the model is valid
|
121
|
-
def valid?
|
122
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
123
|
-
true
|
124
|
-
end
|
125
|
-
|
126
|
-
# Checks equality by comparing each attribute.
|
127
|
-
# @param [Object] Object to be compared
|
128
|
-
def ==(o)
|
129
|
-
return true if self.equal?(o)
|
130
|
-
self.class == o.class &&
|
131
|
-
id == o.id &&
|
132
|
-
name == o.name &&
|
133
|
-
color == o.color &&
|
134
|
-
created_at == o.created_at
|
135
|
-
end
|
136
|
-
|
137
|
-
# @see the `==` method
|
138
|
-
# @param [Object] Object to be compared
|
139
|
-
def eql?(o)
|
140
|
-
self == o
|
141
|
-
end
|
142
|
-
|
143
|
-
# Calculates hash code according to all attributes.
|
144
|
-
# @return [Integer] Hash code
|
145
|
-
def hash
|
146
|
-
[id, name, color, created_at].hash
|
147
|
-
end
|
148
|
-
|
149
|
-
# Builds the object from hash
|
150
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
151
|
-
# @return [Object] Returns the model itself
|
152
|
-
def self.build_from_hash(attributes)
|
153
|
-
return nil unless attributes.is_a?(Hash)
|
154
|
-
attributes = attributes.transform_keys(&:to_sym)
|
155
|
-
transformed_hash = {}
|
156
|
-
openapi_types.each_pair do |key, type|
|
157
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
158
|
-
transformed_hash["#{key}"] = nil
|
159
|
-
elsif type =~ /\AArray<(.*)>/i
|
160
|
-
# check to ensure the input is an array given that the attribute
|
161
|
-
# is documented as an array but the input is not
|
162
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
163
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
164
|
-
end
|
165
|
-
elsif !attributes[attribute_map[key]].nil?
|
166
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
167
|
-
end
|
168
|
-
end
|
169
|
-
new(transformed_hash)
|
170
|
-
end
|
171
|
-
|
172
|
-
# Deserializes the data based on type
|
173
|
-
# @param string type Data type
|
174
|
-
# @param string value Value to be deserialized
|
175
|
-
# @return [Object] Deserialized data
|
176
|
-
def self._deserialize(type, value)
|
177
|
-
case type.to_sym
|
178
|
-
when :Time
|
179
|
-
Time.parse(value)
|
180
|
-
when :Date
|
181
|
-
Date.parse(value)
|
182
|
-
when :String
|
183
|
-
value.to_s
|
184
|
-
when :Integer
|
185
|
-
value.to_i
|
186
|
-
when :Float
|
187
|
-
value.to_f
|
188
|
-
when :Boolean
|
189
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
190
|
-
true
|
191
|
-
else
|
192
|
-
false
|
193
|
-
end
|
194
|
-
when :Object
|
195
|
-
# generic object (usually a Hash), return directly
|
196
|
-
value
|
197
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
198
|
-
inner_type = Regexp.last_match[:inner_type]
|
199
|
-
value.map { |v| _deserialize(inner_type, v) }
|
200
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
201
|
-
k_type = Regexp.last_match[:k_type]
|
202
|
-
v_type = Regexp.last_match[:v_type]
|
203
|
-
{}.tap do |hash|
|
204
|
-
value.each do |k, v|
|
205
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
206
|
-
end
|
207
|
-
end
|
208
|
-
else # model
|
209
|
-
# models (e.g. Pet) or oneOf
|
210
|
-
klass = KatapultAPI.const_get(type)
|
211
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
# Returns the string representation of the object
|
216
|
-
# @return [String] String presentation of the object
|
217
|
-
def to_s
|
218
|
-
to_hash.to_s
|
219
|
-
end
|
220
|
-
|
221
|
-
# to_body is an alias to to_hash (backward compatibility)
|
222
|
-
# @return [Hash] Returns the object in the form of hash
|
223
|
-
def to_body
|
224
|
-
to_hash
|
225
|
-
end
|
226
|
-
|
227
|
-
# Returns the object in the form of hash
|
228
|
-
# @return [Hash] Returns the object in the form of hash
|
229
|
-
def to_hash
|
230
|
-
hash = {}
|
231
|
-
self.class.attribute_map.each_pair do |attr, param|
|
232
|
-
value = self.send(attr)
|
233
|
-
if value.nil?
|
234
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
235
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
236
|
-
end
|
237
|
-
|
238
|
-
hash[param] = _to_hash(value)
|
239
|
-
end
|
240
|
-
hash
|
241
|
-
end
|
242
|
-
|
243
|
-
# Outputs non-array value in the form of hash
|
244
|
-
# For object, use to_hash. Otherwise, just return the value
|
245
|
-
# @param [Object] value Any valid value
|
246
|
-
# @return [Hash] Returns the value in the form of hash
|
247
|
-
def _to_hash(value)
|
248
|
-
if value.is_a?(Array)
|
249
|
-
value.compact.map { |v| _to_hash(v) }
|
250
|
-
elsif value.is_a?(Hash)
|
251
|
-
{}.tap do |hash|
|
252
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
253
|
-
end
|
254
|
-
elsif value.respond_to? :to_hash
|
255
|
-
value.to_hash
|
256
|
-
else
|
257
|
-
value
|
258
|
-
end
|
259
|
-
end
|
260
|
-
|
261
|
-
end
|
262
|
-
|
263
|
-
end
|