From 68f60899f45568eacc906fe74883713b809c4430 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:32:06 -0400 Subject: [PATCH] SWI-3149 Update to Generator Version 7.0.0 (#107) * SWI-3149 Update to Generator Version 7.0.0 * update tests * fix tests again --- .openapi-generator/VERSION | 2 +- bandwidth-sdk.gemspec | 2 +- lib/bandwidth-sdk.rb | 2 +- lib/bandwidth-sdk/api/calls_api.rb | 2 +- lib/bandwidth-sdk/api/conferences_api.rb | 2 +- lib/bandwidth-sdk/api/media_api.rb | 2 +- lib/bandwidth-sdk/api/messages_api.rb | 2 +- lib/bandwidth-sdk/api/mfa_api.rb | 2 +- .../api/phone_number_lookup_api.rb | 2 +- lib/bandwidth-sdk/api/recordings_api.rb | 2 +- lib/bandwidth-sdk/api/statistics_api.rb | 2 +- lib/bandwidth-sdk/api_client.rb | 2 +- lib/bandwidth-sdk/api_error.rb | 2 +- lib/bandwidth-sdk/configuration.rb | 18 ++++--- .../models/account_statistics.rb | 31 +++++------ lib/bandwidth-sdk/models/answer_callback.rb | 31 +++++------ .../models/bridge_complete_callback.rb | 31 +++++------ .../models/bridge_target_complete_callback.rb | 31 +++++------ .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 31 +++++------ lib/bandwidth-sdk/models/call_state.rb | 31 +++++------ lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 47 +++++++++------- lib/bandwidth-sdk/models/conference.rb | 31 +++++------ .../models/conference_completed_callback.rb | 31 +++++------ .../models/conference_created_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/conference_member.rb | 31 +++++------ .../models/conference_member_exit_callback.rb | 31 +++++------ .../models/conference_member_join_callback.rb | 31 +++++------ ...conference_recording_available_callback.rb | 31 +++++------ .../models/conference_recording_metadata.rb | 31 +++++------ .../models/conference_redirect_callback.rb | 31 +++++------ .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 39 +++++++------- .../models/create_call_response.rb | 45 +++++++++------- .../models/create_lookup_response.rb | 31 +++++------ .../models/create_message_request_error.rb | 35 ++++++------ lib/bandwidth-sdk/models/deferred_result.rb | 31 +++++------ .../models/disconnect_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/diversion.rb | 31 +++++------ lib/bandwidth-sdk/models/dtmf_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/field_error.rb | 31 +++++------ lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 31 +++++------ .../models/inbound_message_callback.rb | 41 +++++++------- .../inbound_message_callback_message.rb | 49 ++++++++++------- lib/bandwidth-sdk/models/initiate_callback.rb | 31 +++++------ .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 31 +++++------ lib/bandwidth-sdk/models/lookup_request.rb | 33 ++++++------ lib/bandwidth-sdk/models/lookup_result.rb | 31 +++++------ lib/bandwidth-sdk/models/lookup_status.rb | 31 +++++------ .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 31 +++++------ .../models/machine_detection_configuration.rb | 31 +++++------ .../models/machine_detection_mode_enum.rb | 2 +- .../models/machine_detection_result.rb | 31 +++++------ lib/bandwidth-sdk/models/media.rb | 31 +++++------ lib/bandwidth-sdk/models/message.rb | 39 +++++++------- .../models/message_delivered_callback.rb | 41 +++++++------- .../message_delivered_callback_message.rb | 51 +++++++++++------- .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 43 ++++++++------- .../models/message_failed_callback_message.rb | 53 ++++++++++++------- lib/bandwidth-sdk/models/message_request.rb | 43 ++++++++------- .../models/message_sending_callback.rb | 41 +++++++------- .../message_sending_callback_message.rb | 53 ++++++++++++------- .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 31 +++++------ .../models/messaging_code_response.rb | 31 +++++------ .../models/messaging_request_error.rb | 35 ++++++------ .../models/mfa_forbidden_request_error.rb | 31 +++++------ lib/bandwidth-sdk/models/mfa_request_error.rb | 31 +++++------ .../models/mfa_unauthorized_request_error.rb | 31 +++++------ lib/bandwidth-sdk/models/page_info.rb | 31 +++++------ lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 31 +++++------ .../models/recording_complete_callback.rb | 31 +++++------ .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 31 +++++------ .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 31 +++++------ lib/bandwidth-sdk/models/tag.rb | 31 +++++------ .../models/tn_lookup_request_error.rb | 31 +++++------ .../models/transcribe_recording.rb | 31 +++++------ lib/bandwidth-sdk/models/transcription.rb | 31 +++++------ .../transcription_available_callback.rb | 31 +++++------ .../models/transcription_list.rb | 31 +++++------ .../models/transcription_metadata.rb | 31 +++++------ .../models/transfer_answer_callback.rb | 31 +++++------ .../models/transfer_complete_callback.rb | 31 +++++------ .../models/transfer_disconnect_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/update_call.rb | 31 +++++------ .../models/update_call_recording.rb | 33 ++++++------ lib/bandwidth-sdk/models/update_conference.rb | 31 +++++------ .../models/update_conference_member.rb | 31 +++++------ .../models/verify_code_request.rb | 37 ++++++------- .../models/verify_code_response.rb | 31 +++++------ lib/bandwidth-sdk/models/voice_api_error.rb | 31 +++++------ .../models/voice_code_response.rb | 31 +++++------ lib/bandwidth-sdk/version.rb | 2 +- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 26 ++++++--- spec/models/call_state_spec.rb | 13 ----- spec/models/deferred_result_spec.rb | 15 +----- spec/models/message_spec.rb | 27 ++++------ spec/models/verify_code_request_spec.rb | 22 +++----- 109 files changed, 1236 insertions(+), 1437 deletions(-) diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 4be2c727..757e6740 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index 4113fb03..74e8c475 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index e2b3caf6..27b6a9af 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index d9c5e439..b765186b 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index 6f396982..68f18f51 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index f7a698cb..52773ccf 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 61f2f3bc..b4d87cfd 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index b274830f..723d7699 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index a7cdc355..b6f9d8d3 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index bbce395a..3f1896da 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index a74d64e1..6ed63282 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index 374eaaa9..c662ea3c 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index 0d976daf..ae853593 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 5130c52e..54a949b5 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -151,7 +151,7 @@ def initialize @scheme = 'http' @host = 'localhost' @base_path = '' - @server_index = 0 + @server_index = nil @server_operation_index = {} @server_variables = {} @server_operation_variables = {} @@ -204,10 +204,12 @@ def base_path=(base_path) # Returns base URL for specified operation based on server settings def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) - return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil - - server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + if operation_server_settings.key?(operation) then + index = server_operation_index.fetch(operation, server_index) + server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + else + server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil) + end end # Gets API key (with prefix if set). @@ -479,8 +481,8 @@ def server_url(index, variables = {}, servers = nil) servers = server_settings if servers == nil # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + if (index.nil? || index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}" end server = servers[index] diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index d0a984b6..5c12bf9a 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 15a7ea15..5250e0e8 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -208,6 +208,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -215,6 +216,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -255,37 +257,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index d22cd347..547b5f94 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -228,6 +228,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -235,6 +236,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -277,37 +279,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index 4f2aa82d..d5c41045 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -199,6 +199,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -206,6 +207,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -245,37 +247,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index 05694dc8..606582dc 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index 6dbb56a0..8b51da7f 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -240,6 +240,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -247,6 +248,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -291,37 +293,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index efe8db13..fe4d8da6 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -252,6 +252,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -259,6 +260,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -303,37 +305,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 3972a42e..5177106d 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index 5f6e1fd9..dee2fbb5 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index aac1f586..8ae74b57 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -85,14 +85,20 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'scope') @@ -101,16 +107,21 @@ def initialize(attributes = {}) if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end if attributes.key?(:'digits') self.digits = attributes[:'digits'] + else + self.digits = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -172,6 +183,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) return false if @from.nil? @@ -239,7 +251,11 @@ def application_id=(application_id) # Custom attribute writer method with validation # @param [Object] scope Value to be assigned def scope=(scope) - if !scope.nil? && scope.to_s.length > 25 + if scope.nil? + fail ArgumentError, 'scope cannot be nil' + end + + if scope.to_s.length > 25 fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 25.' end @@ -307,37 +323,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index 4730f092..e8b908b2 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -159,6 +159,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -166,6 +167,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -200,37 +202,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index c5b52d8e..b5e202fc 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 599acd96..cf684c87 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index b57a684b..f12acfbd 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -114,6 +114,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -121,6 +122,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -153,37 +155,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index 2481d04b..416cfd9d 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -131,6 +131,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -138,6 +139,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -172,37 +174,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index 93ed79ed..f1b5f089 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -131,6 +131,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -138,6 +139,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -172,37 +174,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index f98d1fe4..edac9e57 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -207,6 +207,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -214,6 +215,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -254,37 +256,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index 1db9827d..6035e5f8 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -178,6 +178,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -185,6 +186,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -222,37 +224,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index 3611a0fb..f9af8846 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 56b59be3..06f1534b 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index b729affd..dd1128de 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -182,10 +182,14 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'uui') @@ -194,10 +198,14 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'answer_url') self.answer_url = attributes[:'answer_url'] + else + self.answer_url = nil end if attributes.key?(:'answer_method') @@ -272,6 +280,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -351,6 +360,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @from.nil? return false if @application_id.nil? @@ -540,37 +550,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index 47ad1957..e91fecef 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -191,22 +191,32 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] + else + self.account_id = nil end if attributes.key?(:'call_id') self.call_id = attributes[:'call_id'] + else + self.call_id = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'enqueued_time') @@ -215,6 +225,8 @@ def initialize(attributes = {}) if attributes.key?(:'call_url') self.call_url = attributes[:'call_url'] + else + self.call_url = nil end if attributes.key?(:'call_timeout') @@ -237,6 +249,8 @@ def initialize(attributes = {}) if attributes.key?(:'answer_url') self.answer_url = attributes[:'answer_url'] + else + self.answer_url = nil end if attributes.key?(:'answer_fallback_method') @@ -283,6 +297,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') @@ -334,6 +349,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @application_id.nil? return false if @account_id.nil? return false if @call_id.nil? @@ -432,37 +448,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index c1afe401..0b502a91 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -97,6 +97,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -104,6 +105,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -132,37 +134,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index db466f5a..081214f4 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -67,10 +67,14 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'field_errors') @@ -83,6 +87,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') @@ -98,6 +103,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? return false if @description.nil? true @@ -129,37 +135,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index 39f7e9a0..6c667d76 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -73,6 +73,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -80,6 +81,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -108,37 +110,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb index 72ff8110..192b6e6c 100644 --- a/lib/bandwidth-sdk/models/disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -237,6 +237,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -244,6 +245,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -287,37 +289,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index 5b475591..12b914e2 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -120,6 +120,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -127,6 +128,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -160,37 +162,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index 9454c09e..a67a2fbe 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -235,6 +235,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -242,6 +243,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -285,37 +287,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index dfc3448c..a9c2ec36 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 3cb74bdb..7941e020 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index af79fd01..7006ab02 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -244,6 +244,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -251,6 +252,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -295,37 +297,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 4b94c7a2..3d15b616 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index a90f2eb7..12fec95c 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,40 +126,58 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') @@ -180,6 +198,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -223,6 +242,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -280,37 +300,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index 1134e1f9..cb32b374 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -185,6 +185,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -192,6 +193,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -230,37 +232,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index 93c5348e..07a2d72b 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 832ad537..ea9da05e 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -235,6 +235,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -242,6 +243,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -285,37 +287,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index e8128566..e5a96dec 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -62,12 +62,15 @@ def initialize(attributes = {}) if (value = attributes[:'tns']).is_a?(Array) self.tns = value end + else + self.tns = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @tns.nil? invalid_properties.push('invalid value for "tns", tns cannot be nil.') @@ -79,6 +82,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @tns.nil? true end @@ -107,37 +111,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 22108bc3..b09c2126 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -139,6 +139,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -146,6 +147,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -181,37 +183,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index 8962f4cc..39d022ed 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -119,6 +119,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -126,6 +127,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -156,37 +158,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 145152e1..7c10f914 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index de7dd399..236f33c9 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -208,6 +208,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -215,6 +216,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -255,37 +257,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 37e1bba3..d0e7b5d1 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -242,6 +242,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@callback_url.nil? && @callback_url.to_s.length > 2048 invalid_properties.push('invalid value for "callback_url", the character length must be smaller than or equal to 2048.') @@ -273,6 +274,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@callback_url.nil? && @callback_url.to_s.length > 2048 return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 @@ -380,37 +382,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index 69191f24..f2ba8431 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/machine_detection_result.rb b/lib/bandwidth-sdk/models/machine_detection_result.rb index f6bb40b2..acc9bfae 100644 --- a/lib/bandwidth-sdk/models/machine_detection_result.rb +++ b/lib/bandwidth-sdk/models/machine_detection_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,6 +76,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -83,6 +84,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -111,37 +113,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 5002324e..7d658874 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -81,6 +81,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -88,6 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -117,37 +119,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 01a5436c..5463b7ee 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -198,6 +198,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -205,18 +206,27 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end # Custom attribute writer method with validation # @param [Object] to Value to be assigned def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + @to = to end # Custom attribute writer method with validation # @param [Object] media Value to be assigned def media=(media) + if media.nil? + fail ArgumentError, 'media cannot be nil' + end + @media = media end @@ -256,37 +266,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 87ef6c72..69e74004 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index 5ca0b7fe..ed0a91ad 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,44 +126,64 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') self.tag = attributes[:'tag'] + else + self.tag = nil end if attributes.key?(:'media') @@ -180,6 +200,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -227,6 +248,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -285,37 +307,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index 993da1ac..45b72c4b 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 8e1620b1..855464d4 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -80,32 +80,45 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end if attributes.key?(:'error_code') self.error_code = attributes[:'error_code'] + else + self.error_code = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -137,6 +150,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -175,37 +189,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index 579b1e48..b7811538 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,44 +126,64 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') self.tag = attributes[:'tag'] + else + self.tag = nil end if attributes.key?(:'media') @@ -174,12 +194,15 @@ def initialize(attributes = {}) if attributes.key?(:'priority') self.priority = attributes[:'priority'] + else + self.priority = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -231,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -290,37 +314,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 6be9d8eb..c204be9e 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -116,16 +116,22 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') @@ -154,6 +160,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') @@ -177,6 +184,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @application_id.nil? return false if @to.nil? return false if @from.nil? @@ -197,7 +205,11 @@ def to=(to) # Custom attribute writer method with validation # @param [Object] text Value to be assigned def text=(text) - if !text.nil? && text.to_s.length > 2048 + if text.nil? + fail ArgumentError, 'text cannot be nil' + end + + if text.to_s.length > 2048 fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 2048.' end @@ -235,37 +247,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index 6123c2f2..2fb923d2 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index 5e132032..74526012 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,40 +126,58 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') @@ -170,16 +188,21 @@ def initialize(attributes = {}) if (value = attributes[:'media']).is_a?(Array) self.media = value end + else + self.media = nil end if attributes.key?(:'priority') self.priority = attributes[:'priority'] + else + self.priority = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -231,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -290,37 +314,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index e30fb931..1762e105 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 5250d3aa..3418b2a0 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 613369bf..5baa2cf1 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -84,6 +84,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -91,6 +92,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -120,37 +122,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index c155752e..db230699 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 634d822f..18172206 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -63,16 +63,21 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') @@ -88,6 +93,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? return false if @description.nil? true @@ -118,37 +124,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index 4ab2469e..d8cb5463 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index 163f5d13..d809f1dd 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 78ab188e..3e926bdf 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index c705492b..ba0d2b4e 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -93,6 +93,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -100,6 +101,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -130,37 +132,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index 0bf5aa30..e28c54cc 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index a964f677..1ad492f9 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -279,6 +279,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -286,6 +287,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -334,37 +336,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index cf13042d..8414189c 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -280,6 +280,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -287,6 +288,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -335,37 +337,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index b4fcdc2d..6950cca6 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index 0f0dfcec..a91b7ecb 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -226,6 +226,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -233,6 +234,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -275,37 +277,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index 9399170c..901afb20 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 33beb330..909e6f29 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -84,6 +84,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -91,6 +92,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -120,37 +122,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index 4bfe0c70..c77c90d5 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -73,6 +73,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -80,6 +81,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -108,37 +110,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index 07eda0b5..c847b9ed 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index e59bfc62..babafd2e 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -153,6 +153,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -176,6 +177,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@callback_timeout.nil? && @callback_timeout > 25 @@ -247,37 +249,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index 40e4fc5b..ac98b024 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index c0ba4200..37c70d89 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -269,6 +269,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -276,6 +277,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -323,37 +325,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 8cc2b34e..7a45c478 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -67,6 +67,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -74,6 +75,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -101,37 +103,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index bdfcda12..9c90ce27 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -94,6 +94,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -101,6 +102,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -131,37 +133,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index 5c4a22e2..ecd78321 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -217,6 +217,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -224,6 +225,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -265,37 +267,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index 12158800..c6bbd2c7 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -246,6 +246,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -253,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -297,37 +299,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index de8c0128..fcdbe423 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -264,6 +264,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -271,6 +272,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -317,37 +319,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index e932fc63..bde07500 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -182,6 +182,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -209,6 +210,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 @@ -300,37 +302,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index 3ab55e7e..edbb6e8c 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -81,12 +81,15 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] + else + self.state = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @state.nil? invalid_properties.push('invalid value for "state", state cannot be nil.') @@ -98,6 +101,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @state.nil? true end @@ -126,37 +130,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index decb8270..909ac83c 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -172,6 +172,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -195,6 +196,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 @@ -274,37 +276,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 496557cf..2fa48dc5 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -87,6 +87,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -94,6 +95,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -123,37 +125,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index cc03f213..6552bc26 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,8 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'scope') @@ -83,16 +85,21 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_time_in_minutes') self.expiration_time_in_minutes = attributes[:'expiration_time_in_minutes'] + else + self.expiration_time_in_minutes = nil end if attributes.key?(:'code') self.code = attributes[:'code'] + else + self.code = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -133,6 +140,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) return false if @expiration_time_in_minutes.nil? @@ -222,37 +230,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index ecf713f0..b2708e28 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index 2e695780..d7700ea2 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -82,6 +82,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -89,6 +90,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -118,37 +120,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index ebf0b0ea..3d201145 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index b63906fc..b4dfe81c 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index b6ac4cae..9fa7df7a 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -288,7 +288,7 @@ describe '#build_request_url' do it 'adds leading and trailing slashes to path' do - expect(api_client_default.build_request_url('test/path')).to eq('/test/path') + expect(api_client_default.build_request_url('test/path')).to eq('http://localhost/test/path') end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index c0b3da99..dc65ef63 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -53,19 +53,31 @@ end describe '#base_url' do - it 'Returns default base URL when server_index is nil' do - config.server_index = nil - expect(config.base_url).to eq('http://localhost') - end - - it 'returns empty string when invalid operation is passed' do - expect(config.base_url('invalid_operation')).to eq('') + it 'returns default value when invalid operation is passed' do + expect(config.base_url('invalid_operation')).to eq('http://localhost') end it 'returns proper base URL when server index is set' do operation, server = config.operation_server_settings.first expect(config.base_url(operation)).to eq(server[0][:url]) end + + it 'should have the default value' do + expect(config.base_url).to eq('http://localhost') + end + + it 'returns default value when invalid operation is passed' do + expect(config.base_url('invalid_operation')).to eq('http://localhost') + end + + it 'throws argument error when attempting to use a server index that is out of bounds' do + config.server_operation_index = { + :'MediaApi.upload_media' => 10 + } + expect { + config.base_url(:'MediaApi.upload_media') + }.to raise_error(ArgumentError, 'Invalid index 10 when selecting the server. Must not be nil and must be less than 1') + end end describe '#api_key_with_prefix' do diff --git a/spec/models/call_state_spec.rb b/spec/models/call_state_spec.rb index 55c5a6dd..41b549aa 100644 --- a/spec/models/call_state_spec.rb +++ b/spec/models/call_state_spec.rb @@ -118,12 +118,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(call_state_default.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(call_state_default.hash).to be_instance_of(Integer) @@ -136,13 +130,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(call_state_default).to be_valid - expect(call_state_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(call_state_default.eql?(Bandwidth::CallState.new)).to be true diff --git a/spec/models/deferred_result_spec.rb b/spec/models/deferred_result_spec.rb index e092911c..8a0c2e0b 100644 --- a/spec/models/deferred_result_spec.rb +++ b/spec/models/deferred_result_spec.rb @@ -43,13 +43,7 @@ expect(deferred_result_from_hash.set_or_expired).to be true end end - - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(deferred_result_default.list_invalid_properties).to eq([]) - end - end - + describe '#hash' do it 'returns a hash code according to attributes' do expect(deferred_result_default.hash).to be_instance_of(Integer) @@ -62,13 +56,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(deferred_result_default).to be_valid - expect(deferred_result_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(deferred_result_default.eql?(Bandwidth::DeferredResult.new)).to be true diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index 05f04423..c2c745b6 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -7,7 +7,7 @@ application_id: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segment_count: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], @@ -37,6 +37,12 @@ end end + describe 'enum validation' do + it 'works' do + + end + end + describe 'EnumAttributeValidator' do it 'validates string enum' do validator = Bandwidth::Message::EnumAttributeValidator.new(String, ['valid']) @@ -65,7 +71,7 @@ applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segmentCount: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], @@ -80,7 +86,7 @@ expect(message_from_hash.application_id).to eq('93de2206-9669-4e07-948d-329f4b722ee2') expect(message_from_hash.time).to eq(Time.parse('2022-06-16T13:15:07.160Z')) expect(message_from_hash.segment_count).to eq(2) - expect(message_from_hash.direction).to eq('in') + expect(message_from_hash.direction).to eq(Bandwidth::MessageDirectionEnum::IN) expect(message_from_hash.to).to eq(['+19195551234']) expect(message_from_hash.from).to eq('+19195554321') expect(message_from_hash.media).to eq(['https://dev.bandwidth.com/images/bandwidth-logo.png']) @@ -91,12 +97,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(message_default.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(message_default.hash).to be_instance_of(Integer) @@ -109,13 +109,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(message_default).to be_valid - expect(message_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(message_default.eql?(Bandwidth::Message.new)).to be true @@ -131,7 +124,7 @@ applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segmentCount: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], diff --git a/spec/models/verify_code_request_spec.rb b/spec/models/verify_code_request_spec.rb index 643a2ed7..48673ff5 100644 --- a/spec/models/verify_code_request_spec.rb +++ b/spec/models/verify_code_request_spec.rb @@ -1,6 +1,5 @@ # Unit tests for Bandwidth::VerifyCodeRequest describe Bandwidth::VerifyCodeRequest do - let(:verify_code_request_default) { Bandwidth::VerifyCodeRequest.new } let(:verify_code_request_values) { Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', scope: '2FA', @@ -50,12 +49,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(verify_code_request_values.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(verify_code_request_values.hash).to be_instance_of(Integer) @@ -68,16 +61,15 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(verify_code_request_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do - expect(verify_code_request_default.eql?(Bandwidth::VerifyCodeRequest.new)).to be true - expect(verify_code_request_default.eql?(verify_code_request_values)).to be false + verify_code_request_equal = Bandwidth::VerifyCodeRequest.new({ + to: '+19195551234', + scope: '2FA', + expiration_time_in_minutes: 1.0, + code: '123456' + }) + expect(verify_code_request_equal.eql?(verify_code_request_values)).to be true end end