katapult-ruby 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +121 -57
- data/lib/katapult-ruby/models/{interface_not_found_response.rb → api_authenticator400_schema.rb} +5 -17
- data/lib/katapult-ruby/models/certificate_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/country_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/country_state_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/currency_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/data_center_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{location_required_response.rb → data_center_not_found_schema.rb} +5 -17
- data/lib/katapult-ruby/models/delete_ip_address409_response.rb +1 -13
- data/lib/katapult-ruby/models/delete_ssh_key404_response.rb +1 -13
- data/lib/katapult-ruby/models/delete_ssh_key409_response.rb +1 -13
- data/lib/katapult-ruby/models/deletion_restricted_enum.rb +39 -0
- data/lib/katapult-ruby/models/disk_backup_policy_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/disk_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/disk_template_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{ip_already_allocated_response.rb → disk_template_not_found_schema.rb} +5 -17
- data/lib/katapult-ruby/models/disk_template_version_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/dns_record_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/dns_zone_already_verified_enum.rb +39 -0
- data/lib/katapult-ruby/models/dns_zone_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/dns_zone_not_verified_enum.rb +39 -0
- data/lib/katapult-ruby/models/file_storage_volume_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/flexible_resources_unavailable_to_organization_enum.rb +39 -0
- data/lib/katapult-ruby/models/{flexible_resources_unavailable_to_organization_response.rb → flexible_resources_unavailable_to_organization_schema.rb} +4 -16
- data/lib/katapult-ruby/models/get_certificate404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_country404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_country_state404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_currency404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_data_center404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_data_centers400_response.rb +1 -13
- data/lib/katapult-ruby/models/get_data_centers429_response.rb +1 -13
- data/lib/katapult-ruby/models/get_disk404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_disk_backup_policy404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_disk_template404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_disk_template_version404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_dns_records_dns_record404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_dns_zones_dns_zone404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_dns_zones_dns_zone_verification_details422_response.rb +1 -13
- data/lib/katapult-ruby/models/get_file_storage_volume404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_gpu_type404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_ip_address404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_load_balancer404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_load_balancers_rules_load_balancer_rule404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_network404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_operating_system404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_organization404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_security_group404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_security_groups_rules_security_group_rule404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_tag404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_task404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_trash_object404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_users_current404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_virtual_machine_disks404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_virtual_machine_disks406_response.rb +1 -13
- data/lib/katapult-ruby/models/get_virtual_machine_group404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_virtual_machine_package404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_virtual_machines_builds_virtual_machine_build404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_vmnivmni404_response.rb +1 -13
- data/lib/katapult-ruby/models/get_zone404_response.rb +1 -13
- data/lib/katapult-ruby/models/gpu_type_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/identity_not_linked_to_web_session_enum.rb +39 -0
- data/lib/katapult-ruby/models/{network_speed_profile_not_found_response.rb → identity_not_linked_to_web_session_schema.rb} +5 -17
- data/lib/katapult-ruby/models/infrastructure_dns_zone_cannot_be_edited_enum.rb +39 -0
- data/lib/katapult-ruby/models/{infrastructure_dns_zone_cannot_be_edited_response.rb → infrastructure_dns_zone_cannot_be_edited_schema.rb} +4 -16
- data/lib/katapult-ruby/models/interface_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{network_not_found_response.rb → interface_not_found_schema.rb} +5 -17
- data/lib/katapult-ruby/models/invalid_api_token_enum.rb +39 -0
- data/lib/katapult-ruby/models/{invalid_api_token_response.rb → invalid_api_token_schema.rb} +4 -16
- data/lib/katapult-ruby/models/invalid_ip_enum.rb +39 -0
- data/lib/katapult-ruby/models/{invalid_ip_response.rb → invalid_ip_schema.rb} +4 -16
- data/lib/katapult-ruby/models/invalid_spec_xml_enum.rb +39 -0
- data/lib/katapult-ruby/models/invalid_spec_xml_schema.rb +255 -0
- data/lib/katapult-ruby/models/invalid_timestamp_enum.rb +39 -0
- data/lib/katapult-ruby/models/{invalid_spec_xml_response.rb → invalid_timestamp_schema.rb} +6 -18
- data/lib/katapult-ruby/models/ip_address_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{ip_address_not_found_response.rb → ip_address_not_found_schema.rb} +4 -16
- data/lib/katapult-ruby/models/ip_already_allocated_enum.rb +39 -0
- data/lib/katapult-ruby/models/ip_already_allocated_schema.rb +255 -0
- data/lib/katapult-ruby/models/load_balancer_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/load_balancer_rule_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/location_required_enum.rb +39 -0
- data/lib/katapult-ruby/models/location_required_schema.rb +255 -0
- data/lib/katapult-ruby/models/missing_api_token_enum.rb +39 -0
- data/lib/katapult-ruby/models/network_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/network_not_found_schema.rb +255 -0
- data/lib/katapult-ruby/models/network_speed_profile_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/network_speed_profile_not_found_schema.rb +255 -0
- data/lib/katapult-ruby/models/no_allocation_enum.rb +39 -0
- data/lib/katapult-ruby/models/no_available_addresses_enum.rb +39 -0
- data/lib/katapult-ruby/models/no_interface_available_enum.rb +39 -0
- data/lib/katapult-ruby/models/{data_center_not_found_response.rb → no_interface_available_schema.rb} +5 -17
- data/lib/katapult-ruby/models/no_user_associated_with_identity_enum.rb +39 -0
- data/lib/katapult-ruby/models/object_in_trash_enum.rb +39 -0
- data/lib/katapult-ruby/models/{object_in_trash_response.rb → object_in_trash_schema.rb} +4 -16
- data/lib/katapult-ruby/models/one_of_api_authenticator403_response.rb +3 -3
- data/lib/katapult-ruby/models/{one_of_data_center_not_found_virtual_machine_package_not_found_zone_not_found404_error.rb → one_of_data_center_not_found_virtual_machine_package_not_found_zone_not_found404_res.rb} +7 -7
- data/lib/katapult-ruby/models/{one_of_flexible_resources_unavailable_to_organization_permission_denied403_error.rb → one_of_flexible_resources_unavailable_to_organization_permission_denied403_res.rb} +6 -6
- data/lib/katapult-ruby/models/one_of_identity_not_linked_to_web_session400_res.rb +105 -0
- data/lib/katapult-ruby/models/one_of_infrastructure_dns_zone_cannot_be_edited403_res.rb +107 -0
- data/lib/katapult-ruby/models/{one_of_interface_not_found_network_not_found_virtual_machine_not_found404_error.rb → one_of_interface_not_found_network_not_found_virtual_machine_not_found404_res.rb} +4 -4
- data/lib/katapult-ruby/models/{one_of_invalid_spec_xml400_error.rb → one_of_invalid_spec_xml400_res.rb} +3 -3
- data/lib/katapult-ruby/models/{one_of_invalid_timestamp400_error.rb → one_of_invalid_timestamp400_res.rb} +3 -3
- data/lib/katapult-ruby/models/{one_of_ip_address_not_found_virtual_machine_network_interface_not_found404_error.rb → one_of_ip_address_not_found_virtual_machine_network_interface_not_found404_res.rb} +3 -3
- data/lib/katapult-ruby/models/one_of_ip_address_not_found_virtual_machine_not_found404_res.rb +105 -0
- data/lib/katapult-ruby/models/{one_of_ip_already_allocated_invalid_ip422_error.rb → one_of_ip_already_allocated_invalid_ip422_res.rb} +3 -3
- data/lib/katapult-ruby/models/one_of_ip_already_allocated_no_interface_available422_res.rb +105 -0
- data/lib/katapult-ruby/models/{one_of_object_in_trash_task_queueing_error406_error.rb → one_of_location_required_validation_error422_res.rb} +3 -3
- data/lib/katapult-ruby/models/{one_of_location_required_validation_error422_error.rb → one_of_network_not_found_organization_not_found404_res.rb} +3 -3
- data/lib/katapult-ruby/models/{one_of_network_speed_profile_not_found_virtual_machine_network_interface_not_found404_error.rb → one_of_network_speed_profile_not_found_virtual_machine_network_interface_not_found404_res.rb} +3 -3
- data/lib/katapult-ruby/models/one_of_object_in_trash_task_queueing_error406_res.rb +105 -0
- data/lib/katapult-ruby/models/one_of_object_in_trash_virtual_machine_must_be_started406_res.rb +105 -0
- data/lib/katapult-ruby/models/{one_of_ip_address_not_found_virtual_machine_not_found404_error.rb → one_of_operating_system_not_found_organization_not_found404_res.rb} +3 -3
- data/lib/katapult-ruby/models/one_of_organization_limit_reached_validation_error422_res.rb +105 -0
- data/lib/katapult-ruby/models/{one_of_infrastructure_dns_zone_cannot_be_edited403_error.rb → one_of_organization_not_activated_organization_suspended403_res.rb} +6 -5
- data/lib/katapult-ruby/models/{one_of_organization_not_activated_organization_suspended_permission_denied403_error.rb → one_of_organization_not_activated_organization_suspended_permission_denied403_res.rb} +7 -7
- data/lib/katapult-ruby/models/{one_of_organization_not_activated_permission_denied_resource_creation_restricted403_error.rb → one_of_organization_not_activated_permission_denied_resource_creation_restricted403_res.rb} +8 -8
- data/lib/katapult-ruby/models/{one_of_identity_not_linked_to_web_session400_error.rb → one_of_permission_denied403_res.rb} +5 -3
- data/lib/katapult-ruby/models/{one_of_virtual_machine_not_found_virtual_machine_package_not_found404_error.rb → one_of_virtual_machine_not_found_virtual_machine_package_not_found404_res.rb} +3 -3
- data/lib/katapult-ruby/models/operating_system_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{organization_suspended_response.rb → operating_system_not_found_schema.rb} +5 -17
- data/lib/katapult-ruby/models/organization_limit_reached_enum.rb +39 -0
- data/lib/katapult-ruby/models/{virtual_machine_not_found_response.rb → organization_limit_reached_schema.rb} +5 -17
- data/lib/katapult-ruby/models/organization_not_activated_enum.rb +39 -0
- data/lib/katapult-ruby/models/{organization_not_activated_response.rb → organization_not_activated_schema.rb} +4 -16
- data/lib/katapult-ruby/models/organization_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/organization_not_found_schema.rb +255 -0
- data/lib/katapult-ruby/models/organization_suspended_enum.rb +39 -0
- data/lib/katapult-ruby/models/{api_authenticator400_response.rb → organization_suspended_schema.rb} +5 -17
- data/lib/katapult-ruby/models/patch_virtual_machine_network_interface_update_speed_profile406_response.rb +1 -13
- data/lib/katapult-ruby/models/patch_virtual_machine_network_interface_update_speed_profile422_response.rb +1 -13
- data/lib/katapult-ruby/models/permission_denied_enum.rb +39 -0
- data/lib/katapult-ruby/models/{permission_denied_response.rb → permission_denied_schema.rb} +4 -16
- data/lib/katapult-ruby/models/post_dns_zones_dns_zone_verify422_response.rb +1 -13
- data/lib/katapult-ruby/models/post_ip_address_unallocate422_response.rb +1 -13
- data/lib/katapult-ruby/models/post_organization_ip_addresses503_response.rb +1 -13
- data/lib/katapult-ruby/models/post_organization_virtual_machines_build_from_spec422_response.rb +1 -13
- data/lib/katapult-ruby/models/rate_limit_reached_enum.rb +39 -0
- data/lib/katapult-ruby/models/resource_creation_restricted_enum.rb +39 -0
- data/lib/katapult-ruby/models/{organization_limit_reached_response.rb → resource_creation_restricted_schema.rb} +6 -18
- data/lib/katapult-ruby/models/resource_does_not_support_unallocation_enum.rb +39 -0
- data/lib/katapult-ruby/models/scope_not_granted_error_enum.rb +39 -0
- data/lib/katapult-ruby/models/{scope_not_granted_error_response.rb → scope_not_granted_error_schema.rb} +4 -16
- data/lib/katapult-ruby/models/security_group_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/security_group_rule_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/speed_profile_already_assigned_enum.rb +39 -0
- data/lib/katapult-ruby/models/ssh_key_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/tag_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/task_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/task_queueing_error_enum.rb +39 -0
- data/lib/katapult-ruby/models/{task_queueing_error_response.rb → task_queueing_error_schema.rb} +4 -16
- data/lib/katapult-ruby/models/trash_object_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/unauthorized_network_for_api_token_enum.rb +39 -0
- data/lib/katapult-ruby/models/{unauthorized_network_for_api_token_response.rb → unauthorized_network_for_api_token_schema.rb} +4 -16
- data/lib/katapult-ruby/models/validation_error_enum.rb +39 -0
- data/lib/katapult-ruby/models/{validation_error_response.rb → validation_error_schema.rb} +4 -16
- data/lib/katapult-ruby/models/virtual_machine_build_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/virtual_machine_group_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/virtual_machine_must_be_started_enum.rb +39 -0
- data/lib/katapult-ruby/models/{virtual_machine_must_be_started_response.rb → virtual_machine_must_be_started_schema.rb} +4 -16
- data/lib/katapult-ruby/models/virtual_machine_network_interface_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{virtual_machine_network_interface_not_found_response.rb → virtual_machine_network_interface_not_found_schema.rb} +4 -16
- data/lib/katapult-ruby/models/virtual_machine_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{organization_not_found_response.rb → virtual_machine_not_found_schema.rb} +5 -17
- data/lib/katapult-ruby/models/virtual_machine_package_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{virtual_machine_package_not_found_response.rb → virtual_machine_package_not_found_schema.rb} +4 -16
- data/lib/katapult-ruby/models/zone_not_found_enum.rb +39 -0
- data/lib/katapult-ruby/models/{zone_not_found_response.rb → zone_not_found_schema.rb} +4 -16
- data/lib/katapult-ruby/version.rb +1 -1
- data/lib/katapult-ruby.rb +121 -57
- metadata +123 -59
- data/lib/katapult-ruby/models/disk_template_not_found_response.rb +0 -267
- data/lib/katapult-ruby/models/identity_not_linked_to_web_session_response.rb +0 -267
- data/lib/katapult-ruby/models/invalid_timestamp_response.rb +0 -267
- data/lib/katapult-ruby/models/no_interface_available_response.rb +0 -267
- data/lib/katapult-ruby/models/one_of_ip_already_allocated_no_interface_available422_error.rb +0 -105
- data/lib/katapult-ruby/models/one_of_network_not_found_organization_not_found404_error.rb +0 -105
- data/lib/katapult-ruby/models/one_of_object_in_trash_virtual_machine_must_be_started406_error.rb +0 -105
- data/lib/katapult-ruby/models/one_of_operating_system_not_found_organization_not_found404_error.rb +0 -105
- data/lib/katapult-ruby/models/one_of_organization_limit_reached_validation_error422_error.rb +0 -105
- data/lib/katapult-ruby/models/one_of_organization_not_activated_organization_suspended403_error.rb +0 -108
- data/lib/katapult-ruby/models/one_of_permission_denied403_error.rb +0 -107
- data/lib/katapult-ruby/models/operating_system_not_found_response.rb +0 -267
- data/lib/katapult-ruby/models/resource_creation_restricted_response.rb +0 -267
@@ -0,0 +1,39 @@
|
|
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 InfrastructureDNSZoneCannotBeEditedEnum
|
18
|
+
INFRASTRUCTURE_DNS_ZONE_CANNOT_BE_EDITED = "infrastructure_dns_zone_cannot_be_edited".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [INFRASTRUCTURE_DNS_ZONE_CANNOT_BE_EDITED].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if InfrastructureDNSZoneCannotBeEditedEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #InfrastructureDNSZoneCannotBeEditedEnum"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module KatapultAPI
|
17
17
|
# Infrastructure DNS zones cannot be edited through the API. These are managed exclusively by Katapult.
|
18
|
-
class
|
18
|
+
class InfrastructureDNSZoneCannotBeEditedSchema
|
19
19
|
attr_accessor :code
|
20
20
|
|
21
21
|
attr_accessor :description
|
@@ -61,7 +61,7 @@ module KatapultAPI
|
|
61
61
|
# Attribute type mapping.
|
62
62
|
def self.openapi_types
|
63
63
|
{
|
64
|
-
:'code' => :'
|
64
|
+
:'code' => :'InfrastructureDNSZoneCannotBeEditedEnum',
|
65
65
|
:'description' => :'String',
|
66
66
|
:'detail' => :'Object'
|
67
67
|
}
|
@@ -77,13 +77,13 @@ module KatapultAPI
|
|
77
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
78
|
def initialize(attributes = {})
|
79
79
|
if (!attributes.is_a?(Hash))
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::InfrastructureDNSZoneCannotBeEditedSchema` initialize method"
|
81
81
|
end
|
82
82
|
|
83
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
84
84
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
85
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::InfrastructureDNSZoneCannotBeEditedSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
87
|
end
|
88
88
|
h[k.to_sym] = v
|
89
89
|
}
|
@@ -113,21 +113,9 @@ module KatapultAPI
|
|
113
113
|
# @return true if the model is valid
|
114
114
|
def valid?
|
115
115
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
-
code_validator = EnumAttributeValidator.new('String', ["infrastructure_dns_zone_cannot_be_edited"])
|
117
|
-
return false unless code_validator.valid?(@code)
|
118
116
|
true
|
119
117
|
end
|
120
118
|
|
121
|
-
# Custom attribute writer method checking allowed values (enum).
|
122
|
-
# @param [Object] code Object to be assigned
|
123
|
-
def code=(code)
|
124
|
-
validator = EnumAttributeValidator.new('String', ["infrastructure_dns_zone_cannot_be_edited"])
|
125
|
-
unless validator.valid?(code)
|
126
|
-
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
127
|
-
end
|
128
|
-
@code = code
|
129
|
-
end
|
130
|
-
|
131
119
|
# Checks equality by comparing each attribute.
|
132
120
|
# @param [Object] Object to be compared
|
133
121
|
def ==(o)
|
@@ -0,0 +1,39 @@
|
|
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 InterfaceNotFoundEnum
|
18
|
+
INTERFACE_NOT_FOUND = "interface_not_found".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [INTERFACE_NOT_FOUND].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if InterfaceNotFoundEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #InterfaceNotFoundEnum"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/katapult-ruby/models/{network_not_found_response.rb → interface_not_found_schema.rb}
RENAMED
@@ -14,8 +14,8 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module KatapultAPI
|
17
|
-
#
|
18
|
-
class
|
17
|
+
# An interface could not be found for the specified network
|
18
|
+
class InterfaceNotFoundSchema
|
19
19
|
attr_accessor :code
|
20
20
|
|
21
21
|
attr_accessor :description
|
@@ -61,7 +61,7 @@ module KatapultAPI
|
|
61
61
|
# Attribute type mapping.
|
62
62
|
def self.openapi_types
|
63
63
|
{
|
64
|
-
:'code' => :'
|
64
|
+
:'code' => :'InterfaceNotFoundEnum',
|
65
65
|
:'description' => :'String',
|
66
66
|
:'detail' => :'Object'
|
67
67
|
}
|
@@ -77,13 +77,13 @@ module KatapultAPI
|
|
77
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
78
|
def initialize(attributes = {})
|
79
79
|
if (!attributes.is_a?(Hash))
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::InterfaceNotFoundSchema` initialize method"
|
81
81
|
end
|
82
82
|
|
83
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
84
84
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
85
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::InterfaceNotFoundSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
87
|
end
|
88
88
|
h[k.to_sym] = v
|
89
89
|
}
|
@@ -113,21 +113,9 @@ module KatapultAPI
|
|
113
113
|
# @return true if the model is valid
|
114
114
|
def valid?
|
115
115
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
-
code_validator = EnumAttributeValidator.new('String', ["network_not_found"])
|
117
|
-
return false unless code_validator.valid?(@code)
|
118
116
|
true
|
119
117
|
end
|
120
118
|
|
121
|
-
# Custom attribute writer method checking allowed values (enum).
|
122
|
-
# @param [Object] code Object to be assigned
|
123
|
-
def code=(code)
|
124
|
-
validator = EnumAttributeValidator.new('String', ["network_not_found"])
|
125
|
-
unless validator.valid?(code)
|
126
|
-
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
127
|
-
end
|
128
|
-
@code = code
|
129
|
-
end
|
130
|
-
|
131
119
|
# Checks equality by comparing each attribute.
|
132
120
|
# @param [Object] Object to be compared
|
133
121
|
def ==(o)
|
@@ -0,0 +1,39 @@
|
|
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 InvalidAPITokenEnum
|
18
|
+
INVALID_API_TOKEN = "invalid_api_token".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [INVALID_API_TOKEN].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if InvalidAPITokenEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #InvalidAPITokenEnum"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module KatapultAPI
|
17
17
|
# The API token provided was not valid (it may not exist or have expired)
|
18
|
-
class
|
18
|
+
class InvalidAPITokenSchema
|
19
19
|
attr_accessor :code
|
20
20
|
|
21
21
|
attr_accessor :description
|
@@ -61,7 +61,7 @@ module KatapultAPI
|
|
61
61
|
# Attribute type mapping.
|
62
62
|
def self.openapi_types
|
63
63
|
{
|
64
|
-
:'code' => :'
|
64
|
+
:'code' => :'InvalidAPITokenEnum',
|
65
65
|
:'description' => :'String',
|
66
66
|
:'detail' => :'InvalidAPIToken'
|
67
67
|
}
|
@@ -77,13 +77,13 @@ module KatapultAPI
|
|
77
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
78
|
def initialize(attributes = {})
|
79
79
|
if (!attributes.is_a?(Hash))
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::InvalidAPITokenSchema` initialize method"
|
81
81
|
end
|
82
82
|
|
83
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
84
84
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
85
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::InvalidAPITokenSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
87
|
end
|
88
88
|
h[k.to_sym] = v
|
89
89
|
}
|
@@ -113,21 +113,9 @@ module KatapultAPI
|
|
113
113
|
# @return true if the model is valid
|
114
114
|
def valid?
|
115
115
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
-
code_validator = EnumAttributeValidator.new('String', ["invalid_api_token"])
|
117
|
-
return false unless code_validator.valid?(@code)
|
118
116
|
true
|
119
117
|
end
|
120
118
|
|
121
|
-
# Custom attribute writer method checking allowed values (enum).
|
122
|
-
# @param [Object] code Object to be assigned
|
123
|
-
def code=(code)
|
124
|
-
validator = EnumAttributeValidator.new('String', ["invalid_api_token"])
|
125
|
-
unless validator.valid?(code)
|
126
|
-
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
127
|
-
end
|
128
|
-
@code = code
|
129
|
-
end
|
130
|
-
|
131
119
|
# Checks equality by comparing each attribute.
|
132
120
|
# @param [Object] Object to be compared
|
133
121
|
def ==(o)
|
@@ -0,0 +1,39 @@
|
|
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 InvalidIPEnum
|
18
|
+
INVALID_IP = "invalid_ip".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [INVALID_IP].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if InvalidIPEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #InvalidIPEnum"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module KatapultAPI
|
17
17
|
# This IP address is not valid for this network interface.
|
18
|
-
class
|
18
|
+
class InvalidIPSchema
|
19
19
|
attr_accessor :code
|
20
20
|
|
21
21
|
attr_accessor :description
|
@@ -61,7 +61,7 @@ module KatapultAPI
|
|
61
61
|
# Attribute type mapping.
|
62
62
|
def self.openapi_types
|
63
63
|
{
|
64
|
-
:'code' => :'
|
64
|
+
:'code' => :'InvalidIPEnum',
|
65
65
|
:'description' => :'String',
|
66
66
|
:'detail' => :'Object'
|
67
67
|
}
|
@@ -77,13 +77,13 @@ module KatapultAPI
|
|
77
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
78
|
def initialize(attributes = {})
|
79
79
|
if (!attributes.is_a?(Hash))
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::InvalidIPSchema` initialize method"
|
81
81
|
end
|
82
82
|
|
83
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
84
84
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
85
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::InvalidIPSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
87
|
end
|
88
88
|
h[k.to_sym] = v
|
89
89
|
}
|
@@ -113,21 +113,9 @@ module KatapultAPI
|
|
113
113
|
# @return true if the model is valid
|
114
114
|
def valid?
|
115
115
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
-
code_validator = EnumAttributeValidator.new('String', ["invalid_ip"])
|
117
|
-
return false unless code_validator.valid?(@code)
|
118
116
|
true
|
119
117
|
end
|
120
118
|
|
121
|
-
# Custom attribute writer method checking allowed values (enum).
|
122
|
-
# @param [Object] code Object to be assigned
|
123
|
-
def code=(code)
|
124
|
-
validator = EnumAttributeValidator.new('String', ["invalid_ip"])
|
125
|
-
unless validator.valid?(code)
|
126
|
-
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
127
|
-
end
|
128
|
-
@code = code
|
129
|
-
end
|
130
|
-
|
131
119
|
# Checks equality by comparing each attribute.
|
132
120
|
# @param [Object] Object to be compared
|
133
121
|
def ==(o)
|
@@ -0,0 +1,39 @@
|
|
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 InvalidSpecXMLEnum
|
18
|
+
INVALID_SPEC_XML = "invalid_spec_xml".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [INVALID_SPEC_XML].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if InvalidSpecXMLEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #InvalidSpecXMLEnum"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,255 @@
|
|
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
|
+
# The spec XML provided is invalid
|
18
|
+
class InvalidSpecXMLSchema
|
19
|
+
attr_accessor :code
|
20
|
+
|
21
|
+
attr_accessor :description
|
22
|
+
|
23
|
+
attr_accessor :detail
|
24
|
+
|
25
|
+
class EnumAttributeValidator
|
26
|
+
attr_reader :datatype
|
27
|
+
attr_reader :allowable_values
|
28
|
+
|
29
|
+
def initialize(datatype, allowable_values)
|
30
|
+
@allowable_values = allowable_values.map do |value|
|
31
|
+
case datatype.to_s
|
32
|
+
when /Integer/i
|
33
|
+
value.to_i
|
34
|
+
when /Float/i
|
35
|
+
value.to_f
|
36
|
+
else
|
37
|
+
value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def valid?(value)
|
43
|
+
!value || allowable_values.include?(value)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'code' => :'code',
|
51
|
+
:'description' => :'description',
|
52
|
+
:'detail' => :'detail'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.openapi_types
|
63
|
+
{
|
64
|
+
:'code' => :'InvalidSpecXMLEnum',
|
65
|
+
:'description' => :'String',
|
66
|
+
:'detail' => :'InvalidSpecXML'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# List of attributes with nullable: true
|
71
|
+
def self.openapi_nullable
|
72
|
+
Set.new([
|
73
|
+
])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Initializes the object
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
78
|
+
def initialize(attributes = {})
|
79
|
+
if (!attributes.is_a?(Hash))
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KatapultAPI::InvalidSpecXMLSchema` initialize method"
|
81
|
+
end
|
82
|
+
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KatapultAPI::InvalidSpecXMLSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
|
+
end
|
88
|
+
h[k.to_sym] = v
|
89
|
+
}
|
90
|
+
|
91
|
+
if attributes.key?(:'code')
|
92
|
+
self.code = attributes[:'code']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'description')
|
96
|
+
self.description = attributes[:'description']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'detail')
|
100
|
+
self.detail = attributes[:'detail']
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
105
|
+
# @return Array for valid properties with the reasons
|
106
|
+
def list_invalid_properties
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
|
+
invalid_properties = Array.new
|
109
|
+
invalid_properties
|
110
|
+
end
|
111
|
+
|
112
|
+
# Check to see if the all the properties in the model are valid
|
113
|
+
# @return true if the model is valid
|
114
|
+
def valid?
|
115
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
+
true
|
117
|
+
end
|
118
|
+
|
119
|
+
# Checks equality by comparing each attribute.
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def ==(o)
|
122
|
+
return true if self.equal?(o)
|
123
|
+
self.class == o.class &&
|
124
|
+
code == o.code &&
|
125
|
+
description == o.description &&
|
126
|
+
detail == o.detail
|
127
|
+
end
|
128
|
+
|
129
|
+
# @see the `==` method
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def eql?(o)
|
132
|
+
self == o
|
133
|
+
end
|
134
|
+
|
135
|
+
# Calculates hash code according to all attributes.
|
136
|
+
# @return [Integer] Hash code
|
137
|
+
def hash
|
138
|
+
[code, description, detail].hash
|
139
|
+
end
|
140
|
+
|
141
|
+
# Builds the object from hash
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
# @return [Object] Returns the model itself
|
144
|
+
def self.build_from_hash(attributes)
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
146
|
+
attributes = attributes.transform_keys(&:to_sym)
|
147
|
+
transformed_hash = {}
|
148
|
+
openapi_types.each_pair do |key, type|
|
149
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
150
|
+
transformed_hash["#{key}"] = nil
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
155
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
156
|
+
end
|
157
|
+
elsif !attributes[attribute_map[key]].nil?
|
158
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
159
|
+
end
|
160
|
+
end
|
161
|
+
new(transformed_hash)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Deserializes the data based on type
|
165
|
+
# @param string type Data type
|
166
|
+
# @param string value Value to be deserialized
|
167
|
+
# @return [Object] Deserialized data
|
168
|
+
def self._deserialize(type, value)
|
169
|
+
case type.to_sym
|
170
|
+
when :Time
|
171
|
+
Time.parse(value)
|
172
|
+
when :Date
|
173
|
+
Date.parse(value)
|
174
|
+
when :String
|
175
|
+
value.to_s
|
176
|
+
when :Integer
|
177
|
+
value.to_i
|
178
|
+
when :Float
|
179
|
+
value.to_f
|
180
|
+
when :Boolean
|
181
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
182
|
+
true
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
when :Object
|
187
|
+
# generic object (usually a Hash), return directly
|
188
|
+
value
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
192
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each do |k, v|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
else # model
|
201
|
+
# models (e.g. Pet) or oneOf
|
202
|
+
klass = KatapultAPI.const_get(type)
|
203
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the string representation of the object
|
208
|
+
# @return [String] String presentation of the object
|
209
|
+
def to_s
|
210
|
+
to_hash.to_s
|
211
|
+
end
|
212
|
+
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_body
|
216
|
+
to_hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the object in the form of hash
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
221
|
+
def to_hash
|
222
|
+
hash = {}
|
223
|
+
self.class.attribute_map.each_pair do |attr, param|
|
224
|
+
value = self.send(attr)
|
225
|
+
if value.nil?
|
226
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
227
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
228
|
+
end
|
229
|
+
|
230
|
+
hash[param] = _to_hash(value)
|
231
|
+
end
|
232
|
+
hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Outputs non-array value in the form of hash
|
236
|
+
# For object, use to_hash. Otherwise, just return the value
|
237
|
+
# @param [Object] value Any valid value
|
238
|
+
# @return [Hash] Returns the value in the form of hash
|
239
|
+
def _to_hash(value)
|
240
|
+
if value.is_a?(Array)
|
241
|
+
value.compact.map { |v| _to_hash(v) }
|
242
|
+
elsif value.is_a?(Hash)
|
243
|
+
{}.tap do |hash|
|
244
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
245
|
+
end
|
246
|
+
elsif value.respond_to? :to_hash
|
247
|
+
value.to_hash
|
248
|
+
else
|
249
|
+
value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|