Skip to content

Commit

Permalink
SWI-3149 Update to Generator Version 7.0.0 (#107)
Browse files Browse the repository at this point in the history
* SWI-3149 Update to Generator Version 7.0.0

* update tests

* fix tests again
  • Loading branch information
ckoegel authored Jul 26, 2023
1 parent dbe4968 commit 68f6089
Show file tree
Hide file tree
Showing 109 changed files with 1,236 additions and 1,437 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.0.0-SNAPSHOT
2 changes: 1 addition & 1 deletion bandwidth-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/calls_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/conferences_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/media_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/messages_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/mfa_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/phone_number_lookup_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/recordings_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api/statistics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/api_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down
18 changes: 10 additions & 8 deletions lib/bandwidth-sdk/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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]
Expand Down
31 changes: 13 additions & 18 deletions lib/bandwidth-sdk/models/account_statistics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down Expand Up @@ -75,13 +75,15 @@ 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

# 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

Expand Down Expand Up @@ -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)
Expand Down
31 changes: 13 additions & 18 deletions lib/bandwidth-sdk/models/answer_callback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down Expand Up @@ -208,13 +208,15 @@ 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

# 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

Expand Down Expand Up @@ -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)
Expand Down
31 changes: 13 additions & 18 deletions lib/bandwidth-sdk/models/bridge_complete_callback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.5.0
OpenAPI Generator version: 7.0.0-SNAPSHOT
=end

Expand Down Expand Up @@ -228,13 +228,15 @@ 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

# 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

Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 68f6089

Please sign in to comment.