bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/bandwidth-sdk.gemspec +1 -1
  4. data/bandwidth.yml +26 -0
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +264 -295
  7. data/coverage/index.html +2839 -3180
  8. data/docs/CreateCall.md +2 -0
  9. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  10. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  11. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  12. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  13. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  14. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  15. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  16. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  17. data/lib/bandwidth-sdk/api_client.rb +1 -1
  18. data/lib/bandwidth-sdk/api_error.rb +1 -1
  19. data/lib/bandwidth-sdk/configuration.rb +10 -8
  20. data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
  21. data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
  22. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
  23. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
  24. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  25. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
  26. data/lib/bandwidth-sdk/models/call_state.rb +13 -18
  27. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  28. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  29. data/lib/bandwidth-sdk/models/code_request.rb +28 -19
  30. data/lib/bandwidth-sdk/models/conference.rb +13 -18
  31. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
  32. data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
  33. data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
  34. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
  35. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
  36. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
  37. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
  38. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
  39. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  40. data/lib/bandwidth-sdk/models/create_call.rb +48 -19
  41. data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
  42. data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
  43. data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
  44. data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
  45. data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
  46. data/lib/bandwidth-sdk/models/diversion.rb +13 -18
  47. data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
  48. data/lib/bandwidth-sdk/models/field_error.rb +13 -18
  49. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  50. data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
  51. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
  52. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
  53. data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
  54. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  55. data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
  56. data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
  57. data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
  58. data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
  59. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  60. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
  61. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
  62. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  63. data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
  64. data/lib/bandwidth-sdk/models/media.rb +13 -18
  65. data/lib/bandwidth-sdk/models/message.rb +21 -18
  66. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
  67. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
  68. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  69. data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
  70. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
  71. data/lib/bandwidth-sdk/models/message_request.rb +24 -19
  72. data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
  73. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
  74. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  75. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  76. data/lib/bandwidth-sdk/models/messages_list.rb +13 -18
  77. data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
  78. data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
  79. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
  80. data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
  81. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
  82. data/lib/bandwidth-sdk/models/page_info.rb +13 -18
  83. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  84. data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
  85. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
  86. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  87. data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
  88. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  89. data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
  90. data/lib/bandwidth-sdk/models/tag.rb +13 -18
  91. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
  92. data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
  93. data/lib/bandwidth-sdk/models/transcription.rb +13 -18
  94. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
  95. data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
  96. data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
  97. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
  98. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
  99. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
  100. data/lib/bandwidth-sdk/models/update_call.rb +13 -18
  101. data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
  102. data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
  103. data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
  104. data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
  105. data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
  106. data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
  107. data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
  108. data/lib/bandwidth-sdk/version.rb +1 -1
  109. data/lib/bandwidth-sdk.rb +1 -1
  110. data/openapitools.json +1 -1
  111. data/spec/api/calls_api_spec.rb +2 -0
  112. data/spec/api_client_spec.rb +1 -1
  113. data/spec/configuration_spec.rb +19 -7
  114. data/spec/integration/calls_api_integration_spec.rb +2 -0
  115. data/spec/models/call_state_spec.rb +0 -13
  116. data/spec/models/deferred_result_spec.rb +1 -14
  117. data/spec/models/message_spec.rb +10 -17
  118. data/spec/models/verify_code_request_spec.rb +7 -15
  119. metadata +36 -36
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -63,16 +63,21 @@ module Bandwidth
63
63
 
64
64
  if attributes.key?(:'type')
65
65
  self.type = attributes[:'type']
66
+ else
67
+ self.type = nil
66
68
  end
67
69
 
68
70
  if attributes.key?(:'description')
69
71
  self.description = attributes[:'description']
72
+ else
73
+ self.description = nil
70
74
  end
71
75
  end
72
76
 
73
77
  # Show invalid properties with the reasons. Usually used together with valid?
74
78
  # @return Array for valid properties with the reasons
75
79
  def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
81
  invalid_properties = Array.new
77
82
  if @type.nil?
78
83
  invalid_properties.push('invalid value for "type", type cannot be nil.')
@@ -88,6 +93,7 @@ module Bandwidth
88
93
  # Check to see if the all the properties in the model are valid
89
94
  # @return true if the model is valid
90
95
  def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
97
  return false if @type.nil?
92
98
  return false if @description.nil?
93
99
  true
@@ -118,37 +124,30 @@ module Bandwidth
118
124
  # @param [Hash] attributes Model attributes in the form of hash
119
125
  # @return [Object] Returns the model itself
120
126
  def self.build_from_hash(attributes)
121
- new.build_from_hash(attributes)
122
- end
123
-
124
- # Builds the object from hash
125
- # @param [Hash] attributes Model attributes in the form of hash
126
- # @return [Object] Returns the model itself
127
- def build_from_hash(attributes)
128
127
  return nil unless attributes.is_a?(Hash)
129
128
  attributes = attributes.transform_keys(&:to_sym)
130
- self.class.openapi_types.each_pair do |key, type|
131
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
- self.send("#{key}=", nil)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
133
  elsif type =~ /\AArray<(.*)>/i
134
134
  # check to ensure the input is an array given that the attribute
135
135
  # is documented as an array but the input is not
136
- if attributes[self.class.attribute_map[key]].is_a?(Array)
137
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
138
  end
139
- elsif !attributes[self.class.attribute_map[key]].nil?
140
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
141
  end
142
142
  end
143
-
144
- self
143
+ new(transformed_hash)
145
144
  end
146
145
 
147
146
  # Deserializes the data based on type
148
147
  # @param string type Data type
149
148
  # @param string value Value to be deserialized
150
149
  # @return [Object] Deserialized data
151
- def _deserialize(type, value)
150
+ def self._deserialize(type, value)
152
151
  case type.to_sym
153
152
  when :Time
154
153
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -66,6 +66,7 @@ module Bandwidth
66
66
  # Show invalid properties with the reasons. Usually used together with valid?
67
67
  # @return Array for valid properties with the reasons
68
68
  def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
70
  invalid_properties = Array.new
70
71
  invalid_properties
71
72
  end
@@ -73,6 +74,7 @@ module Bandwidth
73
74
  # Check to see if the all the properties in the model are valid
74
75
  # @return true if the model is valid
75
76
  def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
76
78
  true
77
79
  end
78
80
 
@@ -100,37 +102,30 @@ module Bandwidth
100
102
  # @param [Hash] attributes Model attributes in the form of hash
101
103
  # @return [Object] Returns the model itself
102
104
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
105
  return nil unless attributes.is_a?(Hash)
111
106
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
115
111
  elsif type =~ /\AArray<(.*)>/i
116
112
  # check to ensure the input is an array given that the attribute
117
113
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
116
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
119
  end
124
120
  end
125
-
126
- self
121
+ new(transformed_hash)
127
122
  end
128
123
 
129
124
  # Deserializes the data based on type
130
125
  # @param string type Data type
131
126
  # @param string value Value to be deserialized
132
127
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
128
+ def self._deserialize(type, value)
134
129
  case type.to_sym
135
130
  when :Time
136
131
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -75,6 +75,7 @@ module Bandwidth
75
75
  # Show invalid properties with the reasons. Usually used together with valid?
76
76
  # @return Array for valid properties with the reasons
77
77
  def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
79
  invalid_properties = Array.new
79
80
  invalid_properties
80
81
  end
@@ -82,6 +83,7 @@ module Bandwidth
82
83
  # Check to see if the all the properties in the model are valid
83
84
  # @return true if the model is valid
84
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
87
  true
86
88
  end
87
89
 
@@ -110,37 +112,30 @@ module Bandwidth
110
112
  # @param [Hash] attributes Model attributes in the form of hash
111
113
  # @return [Object] Returns the model itself
112
114
  def self.build_from_hash(attributes)
113
- new.build_from_hash(attributes)
114
- end
115
-
116
- # Builds the object from hash
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- # @return [Object] Returns the model itself
119
- def build_from_hash(attributes)
120
115
  return nil unless attributes.is_a?(Hash)
121
116
  attributes = attributes.transform_keys(&:to_sym)
122
- self.class.openapi_types.each_pair do |key, type|
123
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
- self.send("#{key}=", nil)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
125
121
  elsif type =~ /\AArray<(.*)>/i
126
122
  # check to ensure the input is an array given that the attribute
127
123
  # is documented as an array but the input is not
128
- if attributes[self.class.attribute_map[key]].is_a?(Array)
129
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
126
  end
131
- elsif !attributes[self.class.attribute_map[key]].nil?
132
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
129
  end
134
130
  end
135
-
136
- self
131
+ new(transformed_hash)
137
132
  end
138
133
 
139
134
  # Deserializes the data based on type
140
135
  # @param string type Data type
141
136
  # @param string value Value to be deserialized
142
137
  # @return [Object] Deserialized data
143
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
144
139
  case type.to_sym
145
140
  when :Time
146
141
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -66,6 +66,7 @@ module Bandwidth
66
66
  # Show invalid properties with the reasons. Usually used together with valid?
67
67
  # @return Array for valid properties with the reasons
68
68
  def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
70
  invalid_properties = Array.new
70
71
  invalid_properties
71
72
  end
@@ -73,6 +74,7 @@ module Bandwidth
73
74
  # Check to see if the all the properties in the model are valid
74
75
  # @return true if the model is valid
75
76
  def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
76
78
  true
77
79
  end
78
80
 
@@ -100,37 +102,30 @@ module Bandwidth
100
102
  # @param [Hash] attributes Model attributes in the form of hash
101
103
  # @return [Object] Returns the model itself
102
104
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
105
  return nil unless attributes.is_a?(Hash)
111
106
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
115
111
  elsif type =~ /\AArray<(.*)>/i
116
112
  # check to ensure the input is an array given that the attribute
117
113
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
116
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
119
  end
124
120
  end
125
-
126
- self
121
+ new(transformed_hash)
127
122
  end
128
123
 
129
124
  # Deserializes the data based on type
130
125
  # @param string type Data type
131
126
  # @param string value Value to be deserialized
132
127
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
128
+ def self._deserialize(type, value)
134
129
  case type.to_sym
135
130
  when :Time
136
131
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -93,6 +93,7 @@ module Bandwidth
93
93
  # Show invalid properties with the reasons. Usually used together with valid?
94
94
  # @return Array for valid properties with the reasons
95
95
  def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
97
  invalid_properties = Array.new
97
98
  invalid_properties
98
99
  end
@@ -100,6 +101,7 @@ module Bandwidth
100
101
  # Check to see if the all the properties in the model are valid
101
102
  # @return true if the model is valid
102
103
  def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
105
  true
104
106
  end
105
107
 
@@ -130,37 +132,30 @@ module Bandwidth
130
132
  # @param [Hash] attributes Model attributes in the form of hash
131
133
  # @return [Object] Returns the model itself
132
134
  def self.build_from_hash(attributes)
133
- new.build_from_hash(attributes)
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
135
  return nil unless attributes.is_a?(Hash)
141
136
  attributes = attributes.transform_keys(&:to_sym)
142
- self.class.openapi_types.each_pair do |key, type|
143
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
- self.send("#{key}=", nil)
137
+ transformed_hash = {}
138
+ openapi_types.each_pair do |key, type|
139
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = nil
145
141
  elsif type =~ /\AArray<(.*)>/i
146
142
  # check to ensure the input is an array given that the attribute
147
143
  # is documented as an array but the input is not
148
- if attributes[self.class.attribute_map[key]].is_a?(Array)
149
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ if attributes[attribute_map[key]].is_a?(Array)
145
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
146
  end
151
- elsif !attributes[self.class.attribute_map[key]].nil?
152
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
149
  end
154
150
  end
155
-
156
- self
151
+ new(transformed_hash)
157
152
  end
158
153
 
159
154
  # Deserializes the data based on type
160
155
  # @param string type Data type
161
156
  # @param string value Value to be deserialized
162
157
  # @return [Object] Deserialized data
163
- def _deserialize(type, value)
158
+ def self._deserialize(type, value)
164
159
  case type.to_sym
165
160
  when :Time
166
161
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -279,6 +279,7 @@ module Bandwidth
279
279
  # Show invalid properties with the reasons. Usually used together with valid?
280
280
  # @return Array for valid properties with the reasons
281
281
  def list_invalid_properties
282
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
282
283
  invalid_properties = Array.new
283
284
  invalid_properties
284
285
  end
@@ -286,6 +287,7 @@ module Bandwidth
286
287
  # Check to see if the all the properties in the model are valid
287
288
  # @return true if the model is valid
288
289
  def valid?
290
+ warn '[DEPRECATED] the `valid?` method is obsolete'
289
291
  true
290
292
  end
291
293
 
@@ -334,37 +336,30 @@ module Bandwidth
334
336
  # @param [Hash] attributes Model attributes in the form of hash
335
337
  # @return [Object] Returns the model itself
336
338
  def self.build_from_hash(attributes)
337
- new.build_from_hash(attributes)
338
- end
339
-
340
- # Builds the object from hash
341
- # @param [Hash] attributes Model attributes in the form of hash
342
- # @return [Object] Returns the model itself
343
- def build_from_hash(attributes)
344
339
  return nil unless attributes.is_a?(Hash)
345
340
  attributes = attributes.transform_keys(&:to_sym)
346
- self.class.openapi_types.each_pair do |key, type|
347
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
348
- self.send("#{key}=", nil)
341
+ transformed_hash = {}
342
+ openapi_types.each_pair do |key, type|
343
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
344
+ transformed_hash["#{key}"] = nil
349
345
  elsif type =~ /\AArray<(.*)>/i
350
346
  # check to ensure the input is an array given that the attribute
351
347
  # is documented as an array but the input is not
352
- if attributes[self.class.attribute_map[key]].is_a?(Array)
353
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
348
+ if attributes[attribute_map[key]].is_a?(Array)
349
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
354
350
  end
355
- elsif !attributes[self.class.attribute_map[key]].nil?
356
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
351
+ elsif !attributes[attribute_map[key]].nil?
352
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
357
353
  end
358
354
  end
359
-
360
- self
355
+ new(transformed_hash)
361
356
  end
362
357
 
363
358
  # Deserializes the data based on type
364
359
  # @param string type Data type
365
360
  # @param string value Value to be deserialized
366
361
  # @return [Object] Deserialized data
367
- def _deserialize(type, value)
362
+ def self._deserialize(type, value)
368
363
  case type.to_sym
369
364
  when :Time
370
365
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -280,6 +280,7 @@ module Bandwidth
280
280
  # Show invalid properties with the reasons. Usually used together with valid?
281
281
  # @return Array for valid properties with the reasons
282
282
  def list_invalid_properties
283
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
283
284
  invalid_properties = Array.new
284
285
  invalid_properties
285
286
  end
@@ -287,6 +288,7 @@ module Bandwidth
287
288
  # Check to see if the all the properties in the model are valid
288
289
  # @return true if the model is valid
289
290
  def valid?
291
+ warn '[DEPRECATED] the `valid?` method is obsolete'
290
292
  true
291
293
  end
292
294
 
@@ -335,37 +337,30 @@ module Bandwidth
335
337
  # @param [Hash] attributes Model attributes in the form of hash
336
338
  # @return [Object] Returns the model itself
337
339
  def self.build_from_hash(attributes)
338
- new.build_from_hash(attributes)
339
- end
340
-
341
- # Builds the object from hash
342
- # @param [Hash] attributes Model attributes in the form of hash
343
- # @return [Object] Returns the model itself
344
- def build_from_hash(attributes)
345
340
  return nil unless attributes.is_a?(Hash)
346
341
  attributes = attributes.transform_keys(&:to_sym)
347
- self.class.openapi_types.each_pair do |key, type|
348
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
349
- self.send("#{key}=", nil)
342
+ transformed_hash = {}
343
+ openapi_types.each_pair do |key, type|
344
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
345
+ transformed_hash["#{key}"] = nil
350
346
  elsif type =~ /\AArray<(.*)>/i
351
347
  # check to ensure the input is an array given that the attribute
352
348
  # is documented as an array but the input is not
353
- if attributes[self.class.attribute_map[key]].is_a?(Array)
354
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
349
+ if attributes[attribute_map[key]].is_a?(Array)
350
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
355
351
  end
356
- elsif !attributes[self.class.attribute_map[key]].nil?
357
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
352
+ elsif !attributes[attribute_map[key]].nil?
353
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
358
354
  end
359
355
  end
360
-
361
- self
356
+ new(transformed_hash)
362
357
  end
363
358
 
364
359
  # Deserializes the data based on type
365
360
  # @param string type Data type
366
361
  # @param string value Value to be deserialized
367
362
  # @return [Object] Deserialized data
368
- def _deserialize(type, value)
363
+ def self._deserialize(type, value)
369
364
  case type.to_sym
370
365
  when :Time
371
366
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -226,6 +226,7 @@ module Bandwidth
226
226
  # Show invalid properties with the reasons. Usually used together with valid?
227
227
  # @return Array for valid properties with the reasons
228
228
  def list_invalid_properties
229
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
229
230
  invalid_properties = Array.new
230
231
  invalid_properties
231
232
  end
@@ -233,6 +234,7 @@ module Bandwidth
233
234
  # Check to see if the all the properties in the model are valid
234
235
  # @return true if the model is valid
235
236
  def valid?
237
+ warn '[DEPRECATED] the `valid?` method is obsolete'
236
238
  true
237
239
  end
238
240
 
@@ -275,37 +277,30 @@ module Bandwidth
275
277
  # @param [Hash] attributes Model attributes in the form of hash
276
278
  # @return [Object] Returns the model itself
277
279
  def self.build_from_hash(attributes)
278
- new.build_from_hash(attributes)
279
- end
280
-
281
- # Builds the object from hash
282
- # @param [Hash] attributes Model attributes in the form of hash
283
- # @return [Object] Returns the model itself
284
- def build_from_hash(attributes)
285
280
  return nil unless attributes.is_a?(Hash)
286
281
  attributes = attributes.transform_keys(&:to_sym)
287
- self.class.openapi_types.each_pair do |key, type|
288
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
289
- self.send("#{key}=", nil)
282
+ transformed_hash = {}
283
+ openapi_types.each_pair do |key, type|
284
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
285
+ transformed_hash["#{key}"] = nil
290
286
  elsif type =~ /\AArray<(.*)>/i
291
287
  # check to ensure the input is an array given that the attribute
292
288
  # is documented as an array but the input is not
293
- if attributes[self.class.attribute_map[key]].is_a?(Array)
294
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
289
+ if attributes[attribute_map[key]].is_a?(Array)
290
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
295
291
  end
296
- elsif !attributes[self.class.attribute_map[key]].nil?
297
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
292
+ elsif !attributes[attribute_map[key]].nil?
293
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
298
294
  end
299
295
  end
300
-
301
- self
296
+ new(transformed_hash)
302
297
  end
303
298
 
304
299
  # Deserializes the data based on type
305
300
  # @param string type Data type
306
301
  # @param string value Value to be deserialized
307
302
  # @return [Object] Deserialized data
308
- def _deserialize(type, value)
303
+ def self._deserialize(type, value)
309
304
  case type.to_sym
310
305
  when :Time
311
306
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12