diff --git a/.gitignore b/.gitignore
index d78a16a2..6a6c61fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@ build-iPhoneSimulator/
/.bundle/
/vendor/bundle
/lib/bundler/man/
+vendor
# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
diff --git a/AuditApi/VERSION b/AuditApi/VERSION
index 26e33797..e0102586 100644
--- a/AuditApi/VERSION
+++ b/AuditApi/VERSION
@@ -1 +1 @@
-2.0.4
\ No newline at end of file
+2.0.5
diff --git a/AuditApi/lib/pnap_audit_api.rb b/AuditApi/lib/pnap_audit_api.rb
index dda91563..d7664063 100644
--- a/AuditApi/lib/pnap_audit_api.rb
+++ b/AuditApi/lib/pnap_audit_api.rb
@@ -6,13 +6,14 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
# Common files
require 'pnap_audit_api/api_client'
require 'pnap_audit_api/api_error'
+require 'pnap_audit_api/api_model_base'
require 'pnap_audit_api/version'
require 'pnap_audit_api/configuration'
diff --git a/AuditApi/lib/pnap_audit_api/api/events_api.rb b/AuditApi/lib/pnap_audit_api/api/events_api.rb
index 41fdaa56..2f29461d 100644
--- a/AuditApi/lib/pnap_audit_api/api/events_api.rb
+++ b/AuditApi/lib/pnap_audit_api/api/events_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -74,7 +74,7 @@ def events_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/AuditApi/lib/pnap_audit_api/api_client.rb b/AuditApi/lib/pnap_audit_api/api_client.rb
index 0e50d421..0dfa08bd 100644
--- a/AuditApi/lib/pnap_audit_api/api_client.rb
+++ b/AuditApi/lib/pnap_audit_api/api_client.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -52,7 +52,8 @@ def self.default
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
def call_api(http_method, path, opts = {})
request = build_request(http_method, path, opts)
- tempfile = download_file(request) if opts[:return_type] == 'File'
+ tempfile = nil
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
response = request.run
if @config.debugging
@@ -191,19 +192,17 @@ def download_file(request)
chunk.force_encoding(encoding)
tempfile.write(chunk)
end
- # run the request to ensure the tempfile is created successfully before returning it
- request.run
- if tempfile
+ request.on_complete do
+ if !tempfile
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ end
tempfile.close
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
- else
- fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ yield tempfile if block_given?
end
-
- tempfile
end
# Check if the given MIME is a JSON MIME.
@@ -215,7 +214,7 @@ def download_file(request)
# @param [String] mime MIME
# @return [Boolean] True if the MIME is application/json
def json_mime?(mime)
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
end
# Deserialize the response to the given return type.
@@ -282,9 +281,13 @@ def convert_to_type(data, return_type)
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
end
else
- # models (e.g. Pet) or oneOf
+ # models (e.g. Pet) or oneOf/anyOf
klass = AuditApi.const_get(return_type)
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
+ klass.build(data)
+ else
+ klass.build_from_hash(data)
+ end
end
end
@@ -294,7 +297,7 @@ def convert_to_type(data, return_type)
# @param [String] filename the filename to be sanitized
# @return [String] the sanitized filename
def sanitize_filename(filename)
- filename.gsub(/.*[\/\\]/, '')
+ filename.split(/[\/\\]/).last
end
def build_request_url(path, opts = {})
@@ -394,4 +397,4 @@ def build_collection_param(param, collection_format)
end
end
end
-end
+end
\ No newline at end of file
diff --git a/AuditApi/lib/pnap_audit_api/api_error.rb b/AuditApi/lib/pnap_audit_api/api_error.rb
index 2fd02a3d..e5dc5476 100644
--- a/AuditApi/lib/pnap_audit_api/api_error.rb
+++ b/AuditApi/lib/pnap_audit_api/api_error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/AuditApi/lib/pnap_audit_api/api_model_base.rb b/AuditApi/lib/pnap_audit_api/api_model_base.rb
new file mode 100644
index 00000000..e7fcdd30
--- /dev/null
+++ b/AuditApi/lib/pnap_audit_api/api_model_base.rb
@@ -0,0 +1,88 @@
+=begin
+#Audit Log API
+
+#The Audit Logs API lets you read audit log entries and track API calls or activities in the Bare Metal Cloud Portal.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/audit/v1/)
+
+The version of the OpenAPI document: 1.0
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+module AuditApi
+ class ApiModelBase
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = AuditApi.const_get(type)
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/AuditApi/lib/pnap_audit_api/configuration.rb b/AuditApi/lib/pnap_audit_api/configuration.rb
index c861eb2f..98054419 100644
--- a/AuditApi/lib/pnap_audit_api/configuration.rb
+++ b/AuditApi/lib/pnap_audit_api/configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -79,6 +79,14 @@ class Configuration
# @return [true, false]
attr_accessor :debugging
+ # Set this to ignore operation servers for the API client. This is useful when you need to
+ # send requests to a different server than the one specified in the OpenAPI document.
+ # Will default to the base url defined in the spec but can be overridden by setting
+ # `scheme`, `host`, `base_path` directly.
+ # Default to false.
+ # @return [true, false]
+ attr_accessor :ignore_operation_servers
+
# Defines the logger used for debugging.
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
#
@@ -166,6 +174,7 @@ def initialize
@timeout = 0
@params_encoding = nil
@debugging = false
+ @ignore_operation_servers = false
@inject_format = false
@force_ending_format = false
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -200,6 +209,7 @@ def base_path=(base_path)
# Returns base URL for specified operation based on server settings
def base_url(operation = nil)
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
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])
diff --git a/AuditApi/lib/pnap_audit_api/models/error.rb b/AuditApi/lib/pnap_audit_api/models/error.rb
index cd1f58ac..931676ff 100644
--- a/AuditApi/lib/pnap_audit_api/models/error.rb
+++ b/AuditApi/lib/pnap_audit_api/models/error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module AuditApi
- class Error
+ class Error < ApiModelBase
# The description detailing the cause of the error code.
attr_accessor :message
@@ -29,9 +29,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -56,9 +61,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -96,6 +102,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] message Value to be assigned
+ def message=(message)
+ if message.nil?
+ fail ArgumentError, 'message cannot be nil'
+ end
+
+ @message = message
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -140,61 +156,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = AuditApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -211,24 +172,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/AuditApi/lib/pnap_audit_api/models/event.rb b/AuditApi/lib/pnap_audit_api/models/event.rb
index 4f7adf9c..2b98db24 100644
--- a/AuditApi/lib/pnap_audit_api/models/event.rb
+++ b/AuditApi/lib/pnap_audit_api/models/event.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module AuditApi
# The event log.
- class Event
+ class Event < ApiModelBase
# The name of the event.
attr_accessor :name
@@ -33,9 +33,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -61,9 +66,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Event`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -110,6 +116,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] timestamp Value to be assigned
+ def timestamp=(timestamp)
+ if timestamp.nil?
+ fail ArgumentError, 'timestamp cannot be nil'
+ end
+
+ @timestamp = timestamp
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] user_info Value to be assigned
+ def user_info=(user_info)
+ if user_info.nil?
+ fail ArgumentError, 'user_info cannot be nil'
+ end
+
+ @user_info = user_info
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -155,61 +181,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = AuditApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -226,24 +197,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/AuditApi/lib/pnap_audit_api/models/user_info.rb b/AuditApi/lib/pnap_audit_api/models/user_info.rb
index 8ae34217..adb44684 100644
--- a/AuditApi/lib/pnap_audit_api/models/user_info.rb
+++ b/AuditApi/lib/pnap_audit_api/models/user_info.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module AuditApi
# Details related to the user / application performing this request
- class UserInfo
+ class UserInfo < ApiModelBase
# The BMC account ID
attr_accessor :account_id
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::UserInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::UserInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -111,6 +117,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] account_id Value to be assigned
+ def account_id=(account_id)
+ if account_id.nil?
+ fail ArgumentError, 'account_id cannot be nil'
+ end
+
+ @account_id = account_id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] username Value to be assigned
+ def username=(username)
+ if username.nil?
+ fail ArgumentError, 'username cannot be nil'
+ end
+
+ @username = username
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -156,61 +182,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = AuditApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -227,24 +198,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/AuditApi/lib/pnap_audit_api/version.rb b/AuditApi/lib/pnap_audit_api/version.rb
index b9167c61..65eaf869 100644
--- a/AuditApi/lib/pnap_audit_api/version.rb
+++ b/AuditApi/lib/pnap_audit_api/version.rb
@@ -6,8 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
-
+Generator version: 7.20.0
=end
def get_version()
diff --git a/AuditApi/pnap_audit_api.gemspec b/AuditApi/pnap_audit_api.gemspec
index 1bd3858e..d112c551 100644
--- a/AuditApi/pnap_audit_api.gemspec
+++ b/AuditApi/pnap_audit_api.gemspec
@@ -8,7 +8,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -19,14 +19,14 @@ Gem::Specification.new do |s|
s.name = "pnap_audit_api"
s.version = AuditApi::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["PhoenixNAP"]
+ s.authors = ["OpenAPI-Generator"]
s.email = ["support@phoenixnap.com"]
- s.homepage = "https://phoenixnap.com/bare-metal-cloud"
+ s.homepage = "https://openapi-generator.tech"
s.summary = "Audit Log API Ruby Gem"
- s.description = "Audit Log API Ruby Gem"
+ s.description = "The Audit Logs API lets you read audit log entries and track API calls or activities in the Bare Metal Cloud Portal.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/audit/v1/) "
s.license = "MPL-2.0"
s.required_ruby_version = ">= 2.7"
- s.metadata = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
+ s.metadata = {}
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
@@ -36,4 +36,4 @@ Gem::Specification.new do |s|
s.test_files = `find spec/*`.split("\n")
s.executables = []
s.require_paths = ["lib"]
-end
+end
\ No newline at end of file
diff --git a/AuditApi/spec/api/events_api_spec.rb b/AuditApi/spec/api/events_api_spec.rb
index 0575fe0d..bff6f049 100644
--- a/AuditApi/spec/api/events_api_spec.rb
+++ b/AuditApi/spec/api/events_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/AuditApi/spec/models/error_spec.rb b/AuditApi/spec/models/error_spec.rb
index f860c52f..ea63a78c 100644
--- a/AuditApi/spec/models/error_spec.rb
+++ b/AuditApi/spec/models/error_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe AuditApi::Error do
- let(:instance) { AuditApi::Error.new }
+ #let(:instance) { AuditApi::Error.new }
describe 'test an instance of Error' do
it 'should create an instance of Error' do
diff --git a/AuditApi/spec/models/event_spec.rb b/AuditApi/spec/models/event_spec.rb
index 7814465d..9d41acdf 100644
--- a/AuditApi/spec/models/event_spec.rb
+++ b/AuditApi/spec/models/event_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe AuditApi::Event do
- let(:instance) { AuditApi::Event.new }
+ #let(:instance) { AuditApi::Event.new }
describe 'test an instance of Event' do
it 'should create an instance of Event' do
diff --git a/AuditApi/spec/models/user_info_spec.rb b/AuditApi/spec/models/user_info_spec.rb
index 94e749f0..4c364428 100644
--- a/AuditApi/spec/models/user_info_spec.rb
+++ b/AuditApi/spec/models/user_info_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe AuditApi::UserInfo do
- let(:instance) { AuditApi::UserInfo.new }
+ #let(:instance) { AuditApi::UserInfo.new }
describe 'test an instance of UserInfo' do
it 'should create an instance of UserInfo' do
diff --git a/AuditApi/spec/spec_helper.rb b/AuditApi/spec/spec_helper.rb
index 9ae56e67..0c1346ad 100644
--- a/AuditApi/spec/spec_helper.rb
+++ b/AuditApi/spec/spec_helper.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/README.md b/BillingApi/README.md
index 10f37e5a..dcc3b959 100644
--- a/BillingApi/README.md
+++ b/BillingApi/README.md
@@ -153,25 +153,33 @@ Class | Method | HTTP request | Description
- [BillingApi::LocationEnum](docs/LocationEnum.md)
- [BillingApi::OperatingSystemDetails](docs/OperatingSystemDetails.md)
- [BillingApi::OperatingSystemRecord](docs/OperatingSystemRecord.md)
+ - [BillingApi::PackageDetails](docs/PackageDetails.md)
+ - [BillingApi::PackageQuantity](docs/PackageQuantity.md)
- [BillingApi::PackageUnitEnum](docs/PackageUnitEnum.md)
- [BillingApi::PriceUnitEnum](docs/PriceUnitEnum.md)
- [BillingApi::PricingPlan](docs/PricingPlan.md)
- [BillingApi::Product](docs/Product.md)
- [BillingApi::ProductAvailability](docs/ProductAvailability.md)
- [BillingApi::ProductCategoryEnum](docs/ProductCategoryEnum.md)
+ - [BillingApi::ProductLocationEnum](docs/ProductLocationEnum.md)
- [BillingApi::ProductsGet200ResponseInner](docs/ProductsGet200ResponseInner.md)
- [BillingApi::PromoCreditDetails](docs/PromoCreditDetails.md)
- [BillingApi::PublicSubnetDetails](docs/PublicSubnetDetails.md)
- [BillingApi::PublicSubnetRecord](docs/PublicSubnetRecord.md)
+ - [BillingApi::Quantity](docs/Quantity.md)
+ - [BillingApi::QuantityUnitEnum](docs/QuantityUnitEnum.md)
- [BillingApi::RatedUsageGet200ResponseInner](docs/RatedUsageGet200ResponseInner.md)
- [BillingApi::RatedUsageProductCategoryEnum](docs/RatedUsageProductCategoryEnum.md)
- [BillingApi::RatedUsageRecord](docs/RatedUsageRecord.md)
- [BillingApi::Reservation](docs/Reservation.md)
- [BillingApi::ReservationAutoRenewDisableRequest](docs/ReservationAutoRenewDisableRequest.md)
+ - [BillingApi::ReservationDetails](docs/ReservationDetails.md)
- [BillingApi::ReservationInvoicingModelEnum](docs/ReservationInvoicingModelEnum.md)
- [BillingApi::ReservationModelEnum](docs/ReservationModelEnum.md)
- [BillingApi::ReservationProductCategoryEnum](docs/ReservationProductCategoryEnum.md)
- [BillingApi::ReservationRequest](docs/ReservationRequest.md)
+ - [BillingApi::ReservationStateEnum](docs/ReservationStateEnum.md)
+ - [BillingApi::ReservationTerm](docs/ReservationTerm.md)
- [BillingApi::ServerDetails](docs/ServerDetails.md)
- [BillingApi::ServerProduct](docs/ServerProduct.md)
- [BillingApi::ServerProductMetadata](docs/ServerProductMetadata.md)
@@ -181,6 +189,7 @@ Class | Method | HTTP request | Description
- [BillingApi::SystemCreditCauseEnum](docs/SystemCreditCauseEnum.md)
- [BillingApi::SystemCreditDetails](docs/SystemCreditDetails.md)
- [BillingApi::ThresholdConfigurationDetails](docs/ThresholdConfigurationDetails.md)
+ - [BillingApi::Utilization](docs/Utilization.md)
## Documentation for Authorization
diff --git a/BillingApi/VERSION b/BillingApi/VERSION
index 8f9174b4..4a36342f 100644
--- a/BillingApi/VERSION
+++ b/BillingApi/VERSION
@@ -1 +1 @@
-2.1.2
\ No newline at end of file
+3.0.0
diff --git a/BillingApi/docs/BandwidthRecord.md b/BillingApi/docs/BandwidthRecord.md
index 0541137a..75762b0d 100644
--- a/BillingApi/docs/BandwidthRecord.md
+++ b/BillingApi/docs/BandwidthRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
| **metadata** | [**BandwidthDetails**](BandwidthDetails.md) | | |
@@ -50,6 +51,7 @@ instance = BillingApi::BandwidthRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null,
metadata: null
diff --git a/BillingApi/docs/LocationAvailabilityDetail.md b/BillingApi/docs/LocationAvailabilityDetail.md
index 3740628d..e6e8a8e1 100644
--- a/BillingApi/docs/LocationAvailabilityDetail.md
+++ b/BillingApi/docs/LocationAvailabilityDetail.md
@@ -4,7 +4,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
-| **location** | [**LocationEnum**](LocationEnum.md) | | |
+| **location** | [**ProductLocationEnum**](ProductLocationEnum.md) | | |
| **min_quantity_requested** | **Float** | Requested quantity. | |
| **min_quantity_available** | **Boolean** | Is product available in specific location for requested quantity | |
| **available_quantity** | **Float** | Total available quantity of product in specific location. Max value is 10. | |
diff --git a/BillingApi/docs/OperatingSystemRecord.md b/BillingApi/docs/OperatingSystemRecord.md
index 83bbdf90..90c4ea2b 100644
--- a/BillingApi/docs/OperatingSystemRecord.md
+++ b/BillingApi/docs/OperatingSystemRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
| **metadata** | [**OperatingSystemDetails**](OperatingSystemDetails.md) | | |
@@ -50,6 +51,7 @@ instance = BillingApi::OperatingSystemRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null,
metadata: null
diff --git a/BillingApi/docs/PackageDetails.md b/BillingApi/docs/PackageDetails.md
new file mode 100644
index 00000000..456f6481
--- /dev/null
+++ b/BillingApi/docs/PackageDetails.md
@@ -0,0 +1,20 @@
+# BillingApi::PackageDetails
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **package_quantity** | [**PackageQuantity**](PackageQuantity.md) | | [optional] |
+| **package_unit** | [**PackageUnitEnum**](PackageUnitEnum.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::PackageDetails.new(
+ package_quantity: null,
+ package_unit: null
+)
+```
+
diff --git a/BillingApi/docs/PackageQuantity.md b/BillingApi/docs/PackageQuantity.md
new file mode 100644
index 00000000..f4887c01
--- /dev/null
+++ b/BillingApi/docs/PackageQuantity.md
@@ -0,0 +1,20 @@
+# BillingApi::PackageQuantity
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **min** | **Float** | Minimum package quantity. | |
+| **max** | **Float** | Maximum package quantity. | |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::PackageQuantity.new(
+ min: 0,
+ max: 100
+)
+```
+
diff --git a/BillingApi/docs/PricingPlan.md b/BillingApi/docs/PricingPlan.md
index 080e1999..147ed30f 100644
--- a/BillingApi/docs/PricingPlan.md
+++ b/BillingApi/docs/PricingPlan.md
@@ -14,6 +14,7 @@
| **correlated_product_code** | **String** | Product code of the product this product is correlated with | [optional] |
| **package_quantity** | **Float** | Package size per month. | [optional] |
| **package_unit** | [**PackageUnitEnum**](PackageUnitEnum.md) | | [optional] |
+| **package_details** | [**PackageDetails**](PackageDetails.md) | | [optional] |
## Example
@@ -30,7 +31,8 @@ instance = BillingApi::PricingPlan.new(
applicable_discounts: null,
correlated_product_code: s1.c1.small,
package_quantity: 50,
- package_unit: null
+ package_unit: null,
+ package_details: null
)
```
diff --git a/BillingApi/docs/ProductAvailabilityApi.md b/BillingApi/docs/ProductAvailabilityApi.md
index bf3ee158..1e76c6d3 100644
--- a/BillingApi/docs/ProductAvailabilityApi.md
+++ b/BillingApi/docs/ProductAvailabilityApi.md
@@ -31,9 +31,9 @@ opts = {
product_category: ['SERVER'], # Array | Product category. Currently only SERVER category is supported.
product_code: ['inner_example'], # Array |
show_only_min_quantity_available: true, # Boolean | Show only locations where product with requested quantity is available or all locations where product is offered.
- location: [BillingApi::LocationEnum::PHX], # Array |
+ location: [BillingApi::ProductLocationEnum::PHX], # Array |
solution: ['SERVER_RANCHER'], # Array |
- min_quantity: 2 # Float | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
+ min_quantity: 2 # Float | Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10.
}
begin
@@ -70,9 +70,9 @@ end
| **product_category** | [**Array<String>**](String.md) | Product category. Currently only SERVER category is supported. | [optional] |
| **product_code** | [**Array<String>**](String.md) | | [optional] |
| **show_only_min_quantity_available** | **Boolean** | Show only locations where product with requested quantity is available or all locations where product is offered. | [optional][default to true] |
-| **location** | [**Array<LocationEnum>**](LocationEnum.md) | | [optional] |
+| **location** | [**Array<ProductLocationEnum>**](ProductLocationEnum.md) | | [optional] |
| **solution** | [**Array<String>**](String.md) | | [optional] |
-| **min_quantity** | **Float** | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively. | [optional] |
+| **min_quantity** | **Float** | Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10. | [optional] |
### Return type
diff --git a/BillingApi/docs/ProductLocationEnum.md b/BillingApi/docs/ProductLocationEnum.md
new file mode 100644
index 00000000..52557d5e
--- /dev/null
+++ b/BillingApi/docs/ProductLocationEnum.md
@@ -0,0 +1,15 @@
+# BillingApi::ProductLocationEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::ProductLocationEnum.new()
+```
+
diff --git a/BillingApi/docs/PublicSubnetRecord.md b/BillingApi/docs/PublicSubnetRecord.md
index 9551d356..d816f462 100644
--- a/BillingApi/docs/PublicSubnetRecord.md
+++ b/BillingApi/docs/PublicSubnetRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
| **metadata** | [**PublicSubnetDetails**](PublicSubnetDetails.md) | | |
@@ -50,6 +51,7 @@ instance = BillingApi::PublicSubnetRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null,
metadata: null
diff --git a/BillingApi/docs/Quantity.md b/BillingApi/docs/Quantity.md
new file mode 100644
index 00000000..f0daef5a
--- /dev/null
+++ b/BillingApi/docs/Quantity.md
@@ -0,0 +1,20 @@
+# BillingApi::Quantity
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **quantity** | **Float** | Quantity size. | |
+| **unit** | [**QuantityUnitEnum**](QuantityUnitEnum.md) | | |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::Quantity.new(
+ quantity: 30,
+ unit: null
+)
+```
+
diff --git a/BillingApi/docs/QuantityUnitEnum.md b/BillingApi/docs/QuantityUnitEnum.md
new file mode 100644
index 00000000..61571718
--- /dev/null
+++ b/BillingApi/docs/QuantityUnitEnum.md
@@ -0,0 +1,15 @@
+# BillingApi::QuantityUnitEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::QuantityUnitEnum.new()
+```
+
diff --git a/BillingApi/docs/RatedUsageRecord.md b/BillingApi/docs/RatedUsageRecord.md
index 2cc02df8..afe40d23 100644
--- a/BillingApi/docs/RatedUsageRecord.md
+++ b/BillingApi/docs/RatedUsageRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
@@ -49,6 +50,7 @@ instance = BillingApi::RatedUsageRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null
)
diff --git a/BillingApi/docs/Reservation.md b/BillingApi/docs/Reservation.md
index 1e8a8c2b..e5b3c62c 100644
--- a/BillingApi/docs/Reservation.md
+++ b/BillingApi/docs/Reservation.md
@@ -5,11 +5,14 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | The reservation identifier. | |
-| **product_code** | **String** | The code identifying the product. This code has significant across all locations. | |
+| **product_code** | **String** | The code identifying the product. The same code is used for this product across all locations. | |
| **product_category** | [**ReservationProductCategoryEnum**](ReservationProductCategoryEnum.md) | | |
| **location** | [**LocationEnum**](LocationEnum.md) | | |
| **reservation_model** | [**ReservationModelEnum**](ReservationModelEnum.md) | | |
+| **term** | [**ReservationTerm**](ReservationTerm.md) | | [optional] |
+| **reservation_state** | [**ReservationStateEnum**](ReservationStateEnum.md) | | |
| **initial_invoice_model** | [**ReservationInvoicingModelEnum**](ReservationInvoicingModelEnum.md) | | [optional] |
+| **quantity** | [**Quantity**](Quantity.md) | | |
| **start_date_time** | **Time** | The point in time (in UTC) when the reservation starts. | |
| **end_date_time** | **Time** | The point in time (in UTC) when the reservation end. | [optional] |
| **last_renewal_date_time** | **Time** | The point in time (in UTC) when the reservation was renewed last. | [optional] |
@@ -20,6 +23,7 @@
| **price_unit** | [**PriceUnitEnum**](PriceUnitEnum.md) | | |
| **assigned_resource_id** | **String** | The resource ID currently being assigned to Reservation. | [optional] |
| **next_billing_date** | **Date** | Next billing date for Reservation. | [optional] |
+| **utilization** | [**Utilization**](Utilization.md) | | [optional] |
## Example
@@ -32,7 +36,10 @@ instance = BillingApi::Reservation.new(
product_category: null,
location: null,
reservation_model: null,
+ term: null,
+ reservation_state: null,
initial_invoice_model: null,
+ quantity: null,
start_date_time: 2020-03-19T16:39Z,
end_date_time: 2020-04-19T16:39Z,
last_renewal_date_time: 2020-03-19T16:39Z,
@@ -42,7 +49,8 @@ instance = BillingApi::Reservation.new(
price: 175,
price_unit: null,
assigned_resource_id: 83604275-bdba-490a-b87a-978e8dffdb14,
- next_billing_date: Sun Apr 19 00:00:00 UTC 2020
+ next_billing_date: Sun Apr 19 00:00:00 UTC 2020,
+ utilization: null
)
```
diff --git a/BillingApi/docs/ReservationDetails.md b/BillingApi/docs/ReservationDetails.md
new file mode 100644
index 00000000..29e6e55e
--- /dev/null
+++ b/BillingApi/docs/ReservationDetails.md
@@ -0,0 +1,20 @@
+# BillingApi::ReservationDetails
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | The Reservation identifier. | [optional] |
+| **quantity** | [**Quantity**](Quantity.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::ReservationDetails.new(
+ id: 83604275-bdba-490a-b87a-978e8dffdb14,
+ quantity: null
+)
+```
+
diff --git a/BillingApi/docs/ReservationRequest.md b/BillingApi/docs/ReservationRequest.md
index e6e8c465..21585dd8 100644
--- a/BillingApi/docs/ReservationRequest.md
+++ b/BillingApi/docs/ReservationRequest.md
@@ -5,6 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **sku** | **String** | The sku code of product pricing plan. | |
+| **quantity** | [**Quantity**](Quantity.md) | | |
## Example
@@ -12,7 +13,8 @@
require 'pnap_billing_api'
instance = BillingApi::ReservationRequest.new(
- sku: XXX-XXX-XXX
+ sku: XXX-XXX-XXX,
+ quantity: null
)
```
diff --git a/BillingApi/docs/ReservationStateEnum.md b/BillingApi/docs/ReservationStateEnum.md
new file mode 100644
index 00000000..b117cf95
--- /dev/null
+++ b/BillingApi/docs/ReservationStateEnum.md
@@ -0,0 +1,15 @@
+# BillingApi::ReservationStateEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::ReservationStateEnum.new()
+```
+
diff --git a/BillingApi/docs/ReservationTerm.md b/BillingApi/docs/ReservationTerm.md
new file mode 100644
index 00000000..da602902
--- /dev/null
+++ b/BillingApi/docs/ReservationTerm.md
@@ -0,0 +1,20 @@
+# BillingApi::ReservationTerm
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **length_in_months** | **Integer** | Term's length, expressed in months. | |
+| **reservation_model** | [**ReservationModelEnum**](ReservationModelEnum.md) | | |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::ReservationTerm.new(
+ length_in_months: 12,
+ reservation_model: null
+)
+```
+
diff --git a/BillingApi/docs/ReservationsApi.md b/BillingApi/docs/ReservationsApi.md
index c91afa18..cfbff6b5 100644
--- a/BillingApi/docs/ReservationsApi.md
+++ b/BillingApi/docs/ReservationsApi.md
@@ -104,7 +104,7 @@ end
api_instance = BillingApi::ReservationsApi.new
opts = {
- reservation_request: BillingApi::ReservationRequest.new({sku: 'XXX-XXX-XXX'}) # ReservationRequest |
+ reservation_request: BillingApi::ReservationRequest.new({sku: 'XXX-XXX-XXX', quantity: BillingApi::Quantity.new({quantity: 30, unit: BillingApi::QuantityUnitEnum::TB})}) # ReservationRequest |
}
begin
@@ -318,7 +318,7 @@ end
api_instance = BillingApi::ReservationsApi.new
id = 'd90bbea9-5725-47ce-879e-d3905bafac2a' # String | Resource id.
opts = {
- reservation_request: BillingApi::ReservationRequest.new({sku: 'XXX-XXX-XXX'}) # ReservationRequest |
+ reservation_request: BillingApi::ReservationRequest.new({sku: 'XXX-XXX-XXX', quantity: BillingApi::Quantity.new({quantity: 30, unit: BillingApi::QuantityUnitEnum::TB})}) # ReservationRequest |
}
begin
diff --git a/BillingApi/docs/ServerRecord.md b/BillingApi/docs/ServerRecord.md
index c348c486..0902e827 100644
--- a/BillingApi/docs/ServerRecord.md
+++ b/BillingApi/docs/ServerRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
| **metadata** | [**ServerDetails**](ServerDetails.md) | | |
@@ -50,6 +51,7 @@ instance = BillingApi::ServerRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null,
metadata: null
diff --git a/BillingApi/docs/StorageDetails.md b/BillingApi/docs/StorageDetails.md
index af81c844..fe0da945 100644
--- a/BillingApi/docs/StorageDetails.md
+++ b/BillingApi/docs/StorageDetails.md
@@ -4,12 +4,12 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
-| **network_storage_id** | **String** | Network storage ID. | |
-| **network_storage_name** | **String** | Network storage name. | |
-| **volume_id** | **String** | Volume ID. | |
-| **volume_name** | **String** | Volume name. | |
+| **network_storage_id** | **String** | Network storage ID. | [optional] |
+| **network_storage_name** | **String** | Network storage name. | [optional] |
+| **volume_id** | **String** | Volume ID. | [optional] |
+| **volume_name** | **String** | Volume name. | [optional] |
| **capacity_in_gb** | **Integer** | Capacity in GB. | |
-| **created_on** | **Time** | Timestamp when the record was created. | |
+| **created_on** | **Time** | Timestamp when the record was created. | [optional] |
## Example
diff --git a/BillingApi/docs/StorageRecord.md b/BillingApi/docs/StorageRecord.md
index de83c887..7e89a9e7 100644
--- a/BillingApi/docs/StorageRecord.md
+++ b/BillingApi/docs/StorageRecord.md
@@ -19,9 +19,10 @@
| **unit_price_description** | **String** | User friendly description of the unit price. | |
| **quantity** | **Float** | The number of units being charged. | |
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
-| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
-| **correlation_id** | **String** | Holds usage record id | |
+| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | [optional] |
+| **correlation_id** | **String** | Holds usage record id | [optional] |
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
+| **reservation_details** | [**ReservationDetails**](ReservationDetails.md) | | [optional] |
| **discount_details** | [**ApplicableDiscountDetails**](ApplicableDiscountDetails.md) | | [optional] |
| **credit_details** | [**Array<CreditDetails>**](CreditDetails.md) | | [optional] |
| **metadata** | [**StorageDetails**](StorageDetails.md) | | |
@@ -50,6 +51,7 @@ instance = BillingApi::StorageRecord.new(
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
+ reservation_details: null,
discount_details: null,
credit_details: null,
metadata: null
diff --git a/BillingApi/docs/Utilization.md b/BillingApi/docs/Utilization.md
new file mode 100644
index 00000000..9100cd62
--- /dev/null
+++ b/BillingApi/docs/Utilization.md
@@ -0,0 +1,20 @@
+# BillingApi::Utilization
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **quantity** | [**Quantity**](Quantity.md) | | |
+| **percentage** | **Float** | | |
+
+## Example
+
+```ruby
+require 'pnap_billing_api'
+
+instance = BillingApi::Utilization.new(
+ quantity: null,
+ percentage: 30
+)
+```
+
diff --git a/BillingApi/lib/pnap_billing_api.rb b/BillingApi/lib/pnap_billing_api.rb
index 7aec5440..07319119 100644
--- a/BillingApi/lib/pnap_billing_api.rb
+++ b/BillingApi/lib/pnap_billing_api.rb
@@ -6,13 +6,14 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
# Common files
require 'pnap_billing_api/api_client'
require 'pnap_billing_api/api_error'
+require 'pnap_billing_api/api_model_base'
require 'pnap_billing_api/version'
require 'pnap_billing_api/configuration'
@@ -33,25 +34,33 @@
require 'pnap_billing_api/models/location_enum'
require 'pnap_billing_api/models/operating_system_details'
require 'pnap_billing_api/models/operating_system_record'
+require 'pnap_billing_api/models/package_details'
+require 'pnap_billing_api/models/package_quantity'
require 'pnap_billing_api/models/package_unit_enum'
require 'pnap_billing_api/models/price_unit_enum'
require 'pnap_billing_api/models/pricing_plan'
require 'pnap_billing_api/models/product'
require 'pnap_billing_api/models/product_availability'
require 'pnap_billing_api/models/product_category_enum'
+require 'pnap_billing_api/models/product_location_enum'
require 'pnap_billing_api/models/products_get200_response_inner'
require 'pnap_billing_api/models/promo_credit_details'
require 'pnap_billing_api/models/public_subnet_details'
require 'pnap_billing_api/models/public_subnet_record'
+require 'pnap_billing_api/models/quantity'
+require 'pnap_billing_api/models/quantity_unit_enum'
require 'pnap_billing_api/models/rated_usage_get200_response_inner'
require 'pnap_billing_api/models/rated_usage_product_category_enum'
require 'pnap_billing_api/models/rated_usage_record'
require 'pnap_billing_api/models/reservation'
require 'pnap_billing_api/models/reservation_auto_renew_disable_request'
+require 'pnap_billing_api/models/reservation_details'
require 'pnap_billing_api/models/reservation_invoicing_model_enum'
require 'pnap_billing_api/models/reservation_model_enum'
require 'pnap_billing_api/models/reservation_product_category_enum'
require 'pnap_billing_api/models/reservation_request'
+require 'pnap_billing_api/models/reservation_state_enum'
+require 'pnap_billing_api/models/reservation_term'
require 'pnap_billing_api/models/server_details'
require 'pnap_billing_api/models/server_product'
require 'pnap_billing_api/models/server_product_metadata'
@@ -61,6 +70,7 @@
require 'pnap_billing_api/models/system_credit_cause_enum'
require 'pnap_billing_api/models/system_credit_details'
require 'pnap_billing_api/models/threshold_configuration_details'
+require 'pnap_billing_api/models/utilization'
# APIs
require 'pnap_billing_api/api/billing_configurations_api'
diff --git a/BillingApi/lib/pnap_billing_api/api/billing_configurations_api.rb b/BillingApi/lib/pnap_billing_api/api/billing_configurations_api.rb
index 348289f7..ce0c6991 100644
--- a/BillingApi/lib/pnap_billing_api/api/billing_configurations_api.rb
+++ b/BillingApi/lib/pnap_billing_api/api/billing_configurations_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -45,7 +45,7 @@ def account_billing_configuration_me_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BillingApi/lib/pnap_billing_api/api/product_availability_api.rb b/BillingApi/lib/pnap_billing_api/api/product_availability_api.rb
index 7fd524f8..f02082c5 100644
--- a/BillingApi/lib/pnap_billing_api/api/product_availability_api.rb
+++ b/BillingApi/lib/pnap_billing_api/api/product_availability_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -25,9 +25,9 @@ def initialize(api_client = ApiClient.default)
# @option opts [Array] :product_category Product category. Currently only SERVER category is supported.
# @option opts [Array] :product_code
# @option opts [Boolean] :show_only_min_quantity_available Show only locations where product with requested quantity is available or all locations where product is offered. (default to true)
- # @option opts [Array] :location
+ # @option opts [Array] :location
# @option opts [Array] :solution
- # @option opts [Float] :min_quantity Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
+ # @option opts [Float] :min_quantity Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10.
# @return [Array]
def product_availability_get(opts = {})
data, _status_code, _headers = product_availability_get_with_http_info(opts)
@@ -40,9 +40,9 @@ def product_availability_get(opts = {})
# @option opts [Array] :product_category Product category. Currently only SERVER category is supported.
# @option opts [Array] :product_code
# @option opts [Boolean] :show_only_min_quantity_available Show only locations where product with requested quantity is available or all locations where product is offered. (default to true)
- # @option opts [Array] :location
+ # @option opts [Array] :location
# @option opts [Array] :solution
- # @option opts [Float] :min_quantity Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
+ # @option opts [Float] :min_quantity Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10.
# @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
def product_availability_get_with_http_info(opts = {})
if @api_client.config.debugging
@@ -56,6 +56,14 @@ def product_availability_get_with_http_info(opts = {})
if @api_client.config.client_side_validation && opts[:'solution'] && !opts[:'solution'].all? { |item| allowable_values.include?(item) }
fail ArgumentError, "invalid value for \"solution\", must include one of #{allowable_values}"
end
+ if @api_client.config.client_side_validation && !opts[:'min_quantity'].nil? && opts[:'min_quantity'] > 10
+ fail ArgumentError, 'invalid value for "opts[:"min_quantity"]" when calling ProductAvailabilityApi.product_availability_get, must be smaller than or equal to 10.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'min_quantity'].nil? && opts[:'min_quantity'] < 1
+ fail ArgumentError, 'invalid value for "opts[:"min_quantity"]" when calling ProductAvailabilityApi.product_availability_get, must be greater than or equal to 1.'
+ end
+
# resource path
local_var_path = '/product-availability'
@@ -71,7 +79,7 @@ def product_availability_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BillingApi/lib/pnap_billing_api/api/products_api.rb b/BillingApi/lib/pnap_billing_api/api/products_api.rb
index ed113e84..981d31a9 100644
--- a/BillingApi/lib/pnap_billing_api/api/products_api.rb
+++ b/BillingApi/lib/pnap_billing_api/api/products_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -57,7 +57,7 @@ def products_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BillingApi/lib/pnap_billing_api/api/rated_usage_api.rb b/BillingApi/lib/pnap_billing_api/api/rated_usage_api.rb
index 7da7f6a1..d119bca3 100644
--- a/BillingApi/lib/pnap_billing_api/api/rated_usage_api.rb
+++ b/BillingApi/lib/pnap_billing_api/api/rated_usage_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -62,7 +62,7 @@ def rated_usage_get_with_http_info(from_year_month, to_year_month, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -122,7 +122,7 @@ def rated_usage_month_to_date_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BillingApi/lib/pnap_billing_api/api/reservations_api.rb b/BillingApi/lib/pnap_billing_api/api/reservations_api.rb
index 48acc7b2..02be2d02 100644
--- a/BillingApi/lib/pnap_billing_api/api/reservations_api.rb
+++ b/BillingApi/lib/pnap_billing_api/api/reservations_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -48,7 +48,7 @@ def reservations_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -107,7 +107,7 @@ def reservations_post_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -177,7 +177,7 @@ def reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(i
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -245,7 +245,7 @@ def reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(id
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -310,7 +310,7 @@ def reservations_reservation_id_actions_convert_post_with_http_info(id, opts = {
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -378,7 +378,7 @@ def reservations_reservation_id_get_with_http_info(id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BillingApi/lib/pnap_billing_api/api_client.rb b/BillingApi/lib/pnap_billing_api/api_client.rb
index 1e1a46b7..31467a2d 100644
--- a/BillingApi/lib/pnap_billing_api/api_client.rb
+++ b/BillingApi/lib/pnap_billing_api/api_client.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -52,7 +52,8 @@ def self.default
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
def call_api(http_method, path, opts = {})
request = build_request(http_method, path, opts)
- tempfile = download_file(request) if opts[:return_type] == 'File'
+ tempfile = nil
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
response = request.run
if @config.debugging
@@ -191,19 +192,17 @@ def download_file(request)
chunk.force_encoding(encoding)
tempfile.write(chunk)
end
- # run the request to ensure the tempfile is created successfully before returning it
- request.run
- if tempfile
+ request.on_complete do
+ if !tempfile
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ end
tempfile.close
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
- else
- fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ yield tempfile if block_given?
end
-
- tempfile
end
# Check if the given MIME is a JSON MIME.
@@ -215,7 +214,7 @@ def download_file(request)
# @param [String] mime MIME
# @return [Boolean] True if the MIME is application/json
def json_mime?(mime)
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
end
# Deserialize the response to the given return type.
@@ -282,9 +281,13 @@ def convert_to_type(data, return_type)
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
end
else
- # models (e.g. Pet) or oneOf
+ # models (e.g. Pet) or oneOf/anyOf
klass = BillingApi.const_get(return_type)
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
+ klass.build(data)
+ else
+ klass.build_from_hash(data)
+ end
end
end
@@ -294,7 +297,7 @@ def convert_to_type(data, return_type)
# @param [String] filename the filename to be sanitized
# @return [String] the sanitized filename
def sanitize_filename(filename)
- filename.gsub(/.*[\/\\]/, '')
+ filename.split(/[\/\\]/).last
end
def build_request_url(path, opts = {})
@@ -394,4 +397,4 @@ def build_collection_param(param, collection_format)
end
end
end
-end
+end
\ No newline at end of file
diff --git a/BillingApi/lib/pnap_billing_api/api_error.rb b/BillingApi/lib/pnap_billing_api/api_error.rb
index 9b67f9a6..1a4a9f2e 100644
--- a/BillingApi/lib/pnap_billing_api/api_error.rb
+++ b/BillingApi/lib/pnap_billing_api/api_error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/api_model_base.rb b/BillingApi/lib/pnap_billing_api/api_model_base.rb
new file mode 100644
index 00000000..1cac7ee9
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/api_model_base.rb
@@ -0,0 +1,88 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+module BillingApi
+ class ApiModelBase
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = BillingApi.const_get(type)
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/BillingApi/lib/pnap_billing_api/configuration.rb b/BillingApi/lib/pnap_billing_api/configuration.rb
index 5c78bc19..ba71ba01 100644
--- a/BillingApi/lib/pnap_billing_api/configuration.rb
+++ b/BillingApi/lib/pnap_billing_api/configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -79,6 +79,14 @@ class Configuration
# @return [true, false]
attr_accessor :debugging
+ # Set this to ignore operation servers for the API client. This is useful when you need to
+ # send requests to a different server than the one specified in the OpenAPI document.
+ # Will default to the base url defined in the spec but can be overridden by setting
+ # `scheme`, `host`, `base_path` directly.
+ # Default to false.
+ # @return [true, false]
+ attr_accessor :ignore_operation_servers
+
# Defines the logger used for debugging.
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
#
@@ -166,6 +174,7 @@ def initialize
@timeout = 0
@params_encoding = nil
@debugging = false
+ @ignore_operation_servers = false
@inject_format = false
@force_ending_format = false
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -200,6 +209,7 @@ def base_path=(base_path)
# Returns base URL for specified operation based on server settings
def base_url(operation = nil)
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
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])
diff --git a/BillingApi/lib/pnap_billing_api/models/applicable_discount_details.rb b/BillingApi/lib/pnap_billing_api/models/applicable_discount_details.rb
index 0dfba145..dbe6a0aa 100644
--- a/BillingApi/lib/pnap_billing_api/models/applicable_discount_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/applicable_discount_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class ApplicableDiscountDetails
+ class ApplicableDiscountDetails < ApiModelBase
# A unique code associated with the discount.
attr_accessor :code
@@ -58,9 +58,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -94,9 +99,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ApplicableDiscountDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ApplicableDiscountDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -154,6 +160,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] code Value to be assigned
+ def code=(code)
+ if code.nil?
+ fail ArgumentError, 'code cannot be nil'
+ end
+
+ @code = code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] value Value to be assigned
+ def value=(value)
+ if value.nil?
+ fail ArgumentError, 'value cannot be nil'
+ end
+
+ @value = value
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -200,61 +236,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -271,24 +252,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/applicable_discounts.rb b/BillingApi/lib/pnap_billing_api/models/applicable_discounts.rb
index c8b497a0..99c29341 100644
--- a/BillingApi/lib/pnap_billing_api/models/applicable_discounts.rb
+++ b/BillingApi/lib/pnap_billing_api/models/applicable_discounts.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Represents the applicable discount details for a product, including the discounted price and discount information.
- class ApplicableDiscounts
+ class ApplicableDiscounts < ApiModelBase
# The price of the product after applying a discount.
attr_accessor :discounted_price
@@ -29,9 +29,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -56,9 +61,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ApplicableDiscounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ApplicableDiscounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -133,61 +139,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -204,24 +155,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/bandwidth_details.rb b/BillingApi/lib/pnap_billing_api/models/bandwidth_details.rb
index 0d403d2d..70fdae67 100644
--- a/BillingApi/lib/pnap_billing_api/models/bandwidth_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/bandwidth_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of the bandwidth associated with this rated usage record.
- class BandwidthDetails
+ class BandwidthDetails < ApiModelBase
# The amount of GB consumed in ingress (IN).
attr_accessor :ingress_gb
@@ -60,9 +60,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -89,9 +94,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::BandwidthDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::BandwidthDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -144,6 +150,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] ingress_gb Value to be assigned
+ def ingress_gb=(ingress_gb)
+ if ingress_gb.nil?
+ fail ArgumentError, 'ingress_gb cannot be nil'
+ end
+
+ @ingress_gb = ingress_gb
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] egress_gb Value to be assigned
+ def egress_gb=(egress_gb)
+ if egress_gb.nil?
+ fail ArgumentError, 'egress_gb cannot be nil'
+ end
+
+ @egress_gb = egress_gb
+ end
+
# Custom attribute writer method checking allowed values (enum).
# @param [Object] package_unit Object to be assigned
def package_unit=(package_unit)
@@ -200,61 +226,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -271,24 +242,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/bandwidth_record.rb b/BillingApi/lib/pnap_billing_api/models/bandwidth_record.rb
index 34a5b4fd..84be442f 100644
--- a/BillingApi/lib/pnap_billing_api/models/bandwidth_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/bandwidth_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class BandwidthRecord
+ class BandwidthRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -67,6 +67,8 @@ class BandwidthRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -116,15 +118,21 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails',
:'metadata' => :'metadata'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -148,6 +156,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array',
:'metadata' => :'BandwidthDetails'
@@ -175,9 +184,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::BandwidthRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::BandwidthRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -268,20 +278,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -352,14 +362,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
if @metadata.nil?
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
end
@@ -383,12 +385,140 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
return false if @metadata.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -412,6 +542,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details &&
metadata == o.metadata
@@ -426,7 +557,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details, metadata].hash
end
# Builds the object from hash
@@ -452,61 +583,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -523,24 +599,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/configuration_details.rb b/BillingApi/lib/pnap_billing_api/models/configuration_details.rb
index 582318c5..a91d4ff9 100644
--- a/BillingApi/lib/pnap_billing_api/models/configuration_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/configuration_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Billing configuration details.
- class ConfigurationDetails
+ class ConfigurationDetails < ApiModelBase
attr_accessor :threshold_configuration
# Attribute mapping from ruby-style variable name to JSON key.
@@ -25,9 +25,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -51,9 +56,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ConfigurationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ConfigurationDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -121,61 +127,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -192,24 +143,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/credit_details.rb b/BillingApi/lib/pnap_billing_api/models/credit_details.rb
index 04756dc4..81b17a5d 100644
--- a/BillingApi/lib/pnap_billing_api/models/credit_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/credit_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -38,8 +38,7 @@ def build(data)
openapi_one_of.each do |klass|
begin
next if klass == :AnyType # "nullable: true"
- typed_data = find_and_cast_into_type(klass, data)
- return typed_data if typed_data
+ return find_and_cast_into_type(klass, data)
rescue # rescue all errors so we keep iterating even if the current item lookup raises
end
end
@@ -65,7 +64,7 @@ def find_and_cast_into_type(klass, data)
when 'Time'
return Time.parse(data)
when 'Date'
- return Date.parse(data)
+ return Date.iso8601(data)
when 'String'
return data if data.instance_of?(String)
when 'Object' # "type: object"
@@ -88,9 +87,9 @@ def find_and_cast_into_type(klass, data)
return model if model
else
# raise if data contains keys that are not known to the model
- raise unless (data.keys - const.acceptable_attributes).empty?
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
model = const.build_from_hash(data)
- return model if model && model.valid?
+ return model if model
end
end
end
@@ -101,5 +100,4 @@ def find_and_cast_into_type(klass, data)
end
end
end
-
end
diff --git a/BillingApi/lib/pnap_billing_api/models/credit_details_base.rb b/BillingApi/lib/pnap_billing_api/models/credit_details_base.rb
index 41d2f368..3717f40c 100644
--- a/BillingApi/lib/pnap_billing_api/models/credit_details_base.rb
+++ b/BillingApi/lib/pnap_billing_api/models/credit_details_base.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Base credit details value object.
- class CreditDetailsBase
+ class CreditDetailsBase < ApiModelBase
# Amount applied.
attr_accessor :applied_amount
@@ -51,9 +51,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -78,9 +83,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::CreditDetailsBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::CreditDetailsBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -123,6 +129,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] applied_amount Value to be assigned
+ def applied_amount=(applied_amount)
+ if applied_amount.nil?
+ fail ArgumentError, 'applied_amount cannot be nil'
+ end
+
+ @applied_amount = applied_amount
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -167,61 +193,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -238,24 +209,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/credit_type_enum.rb b/BillingApi/lib/pnap_billing_api/models/credit_type_enum.rb
index 7fefb741..e0720365 100644
--- a/BillingApi/lib/pnap_billing_api/models/credit_type_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/credit_type_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/discount_details.rb b/BillingApi/lib/pnap_billing_api/models/discount_details.rb
index 80e96de1..3eefb1db 100644
--- a/BillingApi/lib/pnap_billing_api/models/discount_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/discount_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Represents the details of a discount applied to a product or charge.
- class DiscountDetails
+ class DiscountDetails < ApiModelBase
# A unique code associated with the discount.
attr_accessor :code
@@ -55,9 +55,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -83,9 +88,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::DiscountDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::DiscountDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -139,6 +145,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] code Value to be assigned
+ def code=(code)
+ if code.nil?
+ fail ArgumentError, 'code cannot be nil'
+ end
+
+ @code = code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] value Value to be assigned
+ def value=(value)
+ if value.nil?
+ fail ArgumentError, 'value cannot be nil'
+ end
+
+ @value = value
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -184,61 +220,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -255,24 +236,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/discount_type_enum.rb b/BillingApi/lib/pnap_billing_api/models/discount_type_enum.rb
index 03e03db4..eef750b6 100644
--- a/BillingApi/lib/pnap_billing_api/models/discount_type_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/discount_type_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/error.rb b/BillingApi/lib/pnap_billing_api/models/error.rb
index 69233e68..126b40bf 100644
--- a/BillingApi/lib/pnap_billing_api/models/error.rb
+++ b/BillingApi/lib/pnap_billing_api/models/error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class Error
+ class Error < ApiModelBase
# The description detailing the cause of the error code.
attr_accessor :message
@@ -29,9 +29,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -56,9 +61,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -96,6 +102,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] message Value to be assigned
+ def message=(message)
+ if message.nil?
+ fail ArgumentError, 'message cannot be nil'
+ end
+
+ @message = message
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -140,61 +156,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -211,24 +172,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/gpu_configuration_metadata.rb b/BillingApi/lib/pnap_billing_api/models/gpu_configuration_metadata.rb
index b947e468..2312d680 100644
--- a/BillingApi/lib/pnap_billing_api/models/gpu_configuration_metadata.rb
+++ b/BillingApi/lib/pnap_billing_api/models/gpu_configuration_metadata.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# GPU configuration details.
- class GpuConfigurationMetadata
+ class GpuConfigurationMetadata < ApiModelBase
# GPU card count.
attr_accessor :count
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::GpuConfigurationMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::GpuConfigurationMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -132,61 +138,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -203,24 +154,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/location_availability_detail.rb b/BillingApi/lib/pnap_billing_api/models/location_availability_detail.rb
index 55c79a9b..f7ef1eb4 100644
--- a/BillingApi/lib/pnap_billing_api/models/location_availability_detail.rb
+++ b/BillingApi/lib/pnap_billing_api/models/location_availability_detail.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Info about location, solutions and availability for a product.
- class LocationAvailabilityDetail
+ class LocationAvailabilityDetail < ApiModelBase
attr_accessor :location
# Requested quantity.
@@ -63,15 +63,20 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
def self.openapi_types
{
- :'location' => :'LocationEnum',
+ :'location' => :'ProductLocationEnum',
:'min_quantity_requested' => :'Float',
:'min_quantity_available' => :'Boolean',
:'available_quantity' => :'Float',
@@ -93,9 +98,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::LocationAvailabilityDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::LocationAvailabilityDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -173,6 +179,46 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] min_quantity_requested Value to be assigned
+ def min_quantity_requested=(min_quantity_requested)
+ if min_quantity_requested.nil?
+ fail ArgumentError, 'min_quantity_requested cannot be nil'
+ end
+
+ @min_quantity_requested = min_quantity_requested
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] min_quantity_available Value to be assigned
+ def min_quantity_available=(min_quantity_available)
+ if min_quantity_available.nil?
+ fail ArgumentError, 'min_quantity_available cannot be nil'
+ end
+
+ @min_quantity_available = min_quantity_available
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] available_quantity Value to be assigned
+ def available_quantity=(available_quantity)
+ if available_quantity.nil?
+ fail ArgumentError, 'available_quantity cannot be nil'
+ end
+
+ @available_quantity = available_quantity
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -220,61 +266,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -291,24 +282,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/location_enum.rb b/BillingApi/lib/pnap_billing_api/models/location_enum.rb
index 9bfb7667..eb023e58 100644
--- a/BillingApi/lib/pnap_billing_api/models/location_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/location_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/operating_system_details.rb b/BillingApi/lib/pnap_billing_api/models/operating_system_details.rb
index 57006783..8bff4cdd 100644
--- a/BillingApi/lib/pnap_billing_api/models/operating_system_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/operating_system_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of the operating system associated with this rated usage record.
- class OperatingSystemDetails
+ class OperatingSystemDetails < ApiModelBase
# Number of cores.
attr_accessor :cores
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::OperatingSystemDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::OperatingSystemDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -102,6 +108,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] cores Value to be assigned
+ def cores=(cores)
+ if cores.nil?
+ fail ArgumentError, 'cores cannot be nil'
+ end
+
+ @cores = cores
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] correlation_id Value to be assigned
+ def correlation_id=(correlation_id)
+ if correlation_id.nil?
+ fail ArgumentError, 'correlation_id cannot be nil'
+ end
+
+ @correlation_id = correlation_id
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -146,61 +172,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -217,24 +188,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/operating_system_record.rb b/BillingApi/lib/pnap_billing_api/models/operating_system_record.rb
index 6cf24b7d..495d5b18 100644
--- a/BillingApi/lib/pnap_billing_api/models/operating_system_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/operating_system_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class OperatingSystemRecord
+ class OperatingSystemRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -67,6 +67,8 @@ class OperatingSystemRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -116,15 +118,21 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails',
:'metadata' => :'metadata'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -148,6 +156,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array',
:'metadata' => :'OperatingSystemDetails'
@@ -175,9 +184,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::OperatingSystemRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::OperatingSystemRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -268,20 +278,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -352,14 +362,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
if @metadata.nil?
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
end
@@ -383,12 +385,140 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
return false if @metadata.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -412,6 +542,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details &&
metadata == o.metadata
@@ -426,7 +557,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details, metadata].hash
end
# Builds the object from hash
@@ -452,61 +583,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -523,24 +599,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/package_details.rb b/BillingApi/lib/pnap_billing_api/models/package_details.rb
new file mode 100644
index 00000000..9bf97226
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/package_details.rb
@@ -0,0 +1,179 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ # Represents details object which contains package quantity and its unit.
+ class PackageDetails < ApiModelBase
+ attr_accessor :package_quantity
+
+ attr_accessor :package_unit
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'package_quantity' => :'packageQuantity',
+ :'package_unit' => :'packageUnit'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'package_quantity' => :'PackageQuantity',
+ :'package_unit' => :'PackageUnitEnum'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::PackageDetails` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PackageDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'package_quantity')
+ self.package_quantity = attributes[:'package_quantity']
+ end
+
+ if attributes.key?(:'package_unit')
+ self.package_unit = attributes[:'package_unit']
+ 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
+ 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
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ package_quantity == o.package_quantity &&
+ package_unit == o.package_unit
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [package_quantity, package_unit].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/package_quantity.rb b/BillingApi/lib/pnap_billing_api/models/package_quantity.rb
new file mode 100644
index 00000000..198959da
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/package_quantity.rb
@@ -0,0 +1,193 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ # Represents the package size per month, for a product's pricing plan, including the min quantity and max quantity information.
+ class PackageQuantity < ApiModelBase
+ # Minimum package quantity.
+ attr_accessor :min
+
+ # Maximum package quantity.
+ attr_accessor :max
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'min' => :'min',
+ :'max' => :'max'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'min' => :'Float',
+ :'max' => :'Float'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::PackageQuantity` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PackageQuantity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'min')
+ self.min = attributes[:'min']
+ else
+ self.min = nil
+ end
+
+ if attributes.key?(:'max')
+ self.max = attributes[:'max']
+ else
+ self.max = 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 @min.nil?
+ invalid_properties.push('invalid value for "min", min cannot be nil.')
+ end
+
+ if @max.nil?
+ invalid_properties.push('invalid value for "max", max cannot be nil.')
+ end
+
+ 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'
+ return false if @min.nil?
+ return false if @max.nil?
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] min Value to be assigned
+ def min=(min)
+ if min.nil?
+ fail ArgumentError, 'min cannot be nil'
+ end
+
+ @min = min
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] max Value to be assigned
+ def max=(max)
+ if max.nil?
+ fail ArgumentError, 'max cannot be nil'
+ end
+
+ @max = max
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ min == o.min &&
+ max == o.max
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [min, max].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/package_unit_enum.rb b/BillingApi/lib/pnap_billing_api/models/package_unit_enum.rb
index c08b591f..95bb0760 100644
--- a/BillingApi/lib/pnap_billing_api/models/package_unit_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/package_unit_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/price_unit_enum.rb b/BillingApi/lib/pnap_billing_api/models/price_unit_enum.rb
index 3de7b32e..6aaecde3 100644
--- a/BillingApi/lib/pnap_billing_api/models/price_unit_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/price_unit_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -21,9 +21,10 @@ class PriceUnitEnum
UNIT = "UNIT".freeze
FLAT = "FLAT".freeze
TB_PER_HOUR = "TB_PER_HOUR".freeze
+ TB_PER_MONTH = "TB_PER_MONTH".freeze
def self.all_vars
- @all_vars ||= [HOUR, MONTH, GB, UNIT, FLAT, TB_PER_HOUR].freeze
+ @all_vars ||= [HOUR, MONTH, GB, UNIT, FLAT, TB_PER_HOUR, TB_PER_MONTH].freeze
end
# Builds the enum from string
diff --git a/BillingApi/lib/pnap_billing_api/models/pricing_plan.rb b/BillingApi/lib/pnap_billing_api/models/pricing_plan.rb
index 597ec912..7037cbbe 100644
--- a/BillingApi/lib/pnap_billing_api/models/pricing_plan.rb
+++ b/BillingApi/lib/pnap_billing_api/models/pricing_plan.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Pricing plan details.
- class PricingPlan
+ class PricingPlan < ApiModelBase
# The SKU identifying this pricing plan.
attr_accessor :sku
@@ -43,6 +43,8 @@ class PricingPlan
attr_accessor :package_unit
+ attr_accessor :package_details
+
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
@@ -77,13 +79,19 @@ def self.attribute_map
:'applicable_discounts' => :'applicableDiscounts',
:'correlated_product_code' => :'correlatedProductCode',
:'package_quantity' => :'packageQuantity',
- :'package_unit' => :'packageUnit'
+ :'package_unit' => :'packageUnit',
+ :'package_details' => :'packageDetails'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -98,7 +106,8 @@ def self.openapi_types
:'applicable_discounts' => :'ApplicableDiscounts',
:'correlated_product_code' => :'String',
:'package_quantity' => :'Float',
- :'package_unit' => :'PackageUnitEnum'
+ :'package_unit' => :'PackageUnitEnum',
+ :'package_details' => :'PackageDetails'
}
end
@@ -116,9 +125,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PricingPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PricingPlan`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -172,6 +182,10 @@ def initialize(attributes = {})
if attributes.key?(:'package_unit')
self.package_unit = attributes[:'package_unit']
end
+
+ if attributes.key?(:'package_details')
+ self.package_details = attributes[:'package_details']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -208,7 +222,7 @@ def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @sku.nil?
return false if @location.nil?
- location_validator = EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "AUS", "GLOBAL"])
+ location_validator = EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "GLOBAL"])
return false unless location_validator.valid?(@location)
return false if @pricing_model.nil?
pricing_model_validator = EnumAttributeValidator.new('String', ["HOURLY", "METERED", "ONE_MONTH_RESERVATION", "TWELVE_MONTHS_RESERVATION", "TWENTY_FOUR_MONTHS_RESERVATION", "THIRTY_SIX_MONTHS_RESERVATION", "MONTHLY_PACKAGE", "FREE_TIER"])
@@ -218,10 +232,20 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] sku Value to be assigned
+ def sku=(sku)
+ if sku.nil?
+ fail ArgumentError, 'sku cannot be nil'
+ end
+
+ @sku = sku
+ end
+
# Custom attribute writer method checking allowed values (enum).
# @param [Object] location Object to be assigned
def location=(location)
- validator = EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "AUS", "GLOBAL"])
+ validator = EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "GLOBAL"])
unless validator.valid?(location)
fail ArgumentError, "invalid value for \"location\", must be one of #{validator.allowable_values}."
end
@@ -238,6 +262,26 @@ def pricing_model=(pricing_model)
@pricing_model = pricing_model
end
+ # Custom attribute writer method with validation
+ # @param [Object] price Value to be assigned
+ def price=(price)
+ if price.nil?
+ fail ArgumentError, 'price cannot be nil'
+ end
+
+ @price = price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_unit Value to be assigned
+ def price_unit=(price_unit)
+ if price_unit.nil?
+ fail ArgumentError, 'price_unit cannot be nil'
+ end
+
+ @price_unit = price_unit
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -252,7 +296,8 @@ def ==(o)
applicable_discounts == o.applicable_discounts &&
correlated_product_code == o.correlated_product_code &&
package_quantity == o.package_quantity &&
- package_unit == o.package_unit
+ package_unit == o.package_unit &&
+ package_details == o.package_details
end
# @see the `==` method
@@ -264,7 +309,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [sku, sku_description, location, pricing_model, price, price_unit, applicable_discounts, correlated_product_code, package_quantity, package_unit].hash
+ [sku, sku_description, location, pricing_model, price, price_unit, applicable_discounts, correlated_product_code, package_quantity, package_unit, package_details].hash
end
# Builds the object from hash
@@ -290,61 +335,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -361,24 +351,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/product.rb b/BillingApi/lib/pnap_billing_api/models/product.rb
index c46400f4..ae908f7d 100644
--- a/BillingApi/lib/pnap_billing_api/models/product.rb
+++ b/BillingApi/lib/pnap_billing_api/models/product.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Product details
- class Product
+ class Product < ApiModelBase
# The code identifying the product. This code has significant across all locations.
attr_accessor :product_code
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Product`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Product`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -113,6 +119,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -158,61 +184,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -229,24 +200,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/product_availability.rb b/BillingApi/lib/pnap_billing_api/models/product_availability.rb
index 1164a827..7db6272e 100644
--- a/BillingApi/lib/pnap_billing_api/models/product_availability.rb
+++ b/BillingApi/lib/pnap_billing_api/models/product_availability.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Product availability details.
- class ProductAvailability
+ class ProductAvailability < ApiModelBase
# Product code.
attr_accessor :product_code
@@ -33,9 +33,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -61,9 +66,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ProductAvailability`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ProductAvailability`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -119,6 +125,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location_availability_details Value to be assigned
+ def location_availability_details=(location_availability_details)
+ if location_availability_details.nil?
+ fail ArgumentError, 'location_availability_details cannot be nil'
+ end
+
+ @location_availability_details = location_availability_details
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -164,61 +200,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -235,24 +216,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/product_category_enum.rb b/BillingApi/lib/pnap_billing_api/models/product_category_enum.rb
index 7a2b7b36..4a00ceb4 100644
--- a/BillingApi/lib/pnap_billing_api/models/product_category_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/product_category_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/product_location_enum.rb b/BillingApi/lib/pnap_billing_api/models/product_location_enum.rb
new file mode 100644
index 00000000..52256389
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/product_location_enum.rb
@@ -0,0 +1,44 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ class ProductLocationEnum
+ PHX = "PHX".freeze
+ ASH = "ASH".freeze
+ NLD = "NLD".freeze
+ SGP = "SGP".freeze
+ CHI = "CHI".freeze
+ SEA = "SEA".freeze
+
+ def self.all_vars
+ @all_vars ||= [PHX, ASH, NLD, SGP, CHI, SEA].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if ProductLocationEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #ProductLocationEnum"
+ end
+ end
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/products_get200_response_inner.rb b/BillingApi/lib/pnap_billing_api/models/products_get200_response_inner.rb
index 9d802900..6921e493 100644
--- a/BillingApi/lib/pnap_billing_api/models/products_get200_response_inner.rb
+++ b/BillingApi/lib/pnap_billing_api/models/products_get200_response_inner.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -57,5 +57,4 @@ def build(data)
end
end
end
-
end
diff --git a/BillingApi/lib/pnap_billing_api/models/promo_credit_details.rb b/BillingApi/lib/pnap_billing_api/models/promo_credit_details.rb
index 84dea626..821a8d41 100644
--- a/BillingApi/lib/pnap_billing_api/models/promo_credit_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/promo_credit_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class PromoCreditDetails
+ class PromoCreditDetails < ApiModelBase
# Amount applied.
attr_accessor :applied_amount
@@ -58,9 +58,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -94,9 +99,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PromoCreditDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PromoCreditDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -161,6 +167,46 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] applied_amount Value to be assigned
+ def applied_amount=(applied_amount)
+ if applied_amount.nil?
+ fail ArgumentError, 'applied_amount cannot be nil'
+ end
+
+ @applied_amount = applied_amount
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] coupon_id Value to be assigned
+ def coupon_id=(coupon_id)
+ if coupon_id.nil?
+ fail ArgumentError, 'coupon_id cannot be nil'
+ end
+
+ @coupon_id = coupon_id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] coupon_code Value to be assigned
+ def coupon_code=(coupon_code)
+ if coupon_code.nil?
+ fail ArgumentError, 'coupon_code cannot be nil'
+ end
+
+ @coupon_code = coupon_code
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -207,61 +253,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -278,24 +269,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/public_subnet_details.rb b/BillingApi/lib/pnap_billing_api/models/public_subnet_details.rb
index 78034c50..0ea16530 100644
--- a/BillingApi/lib/pnap_billing_api/models/public_subnet_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/public_subnet_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of public subnets.
- class PublicSubnetDetails
+ class PublicSubnetDetails < ApiModelBase
# Public Subnet identifier as returned by the BMC API.
attr_accessor :id
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -111,6 +117,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] cidr Value to be assigned
+ def cidr=(cidr)
+ if cidr.nil?
+ fail ArgumentError, 'cidr cannot be nil'
+ end
+
+ @cidr = cidr
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] size Value to be assigned
+ def size=(size)
+ if size.nil?
+ fail ArgumentError, 'size cannot be nil'
+ end
+
+ @size = size
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -156,61 +182,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -227,24 +198,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/public_subnet_record.rb b/BillingApi/lib/pnap_billing_api/models/public_subnet_record.rb
index 81d9e9f8..269546ba 100644
--- a/BillingApi/lib/pnap_billing_api/models/public_subnet_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/public_subnet_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class PublicSubnetRecord
+ class PublicSubnetRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -67,6 +67,8 @@ class PublicSubnetRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -116,15 +118,21 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails',
:'metadata' => :'metadata'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -148,6 +156,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array',
:'metadata' => :'PublicSubnetDetails'
@@ -175,9 +184,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -268,20 +278,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -352,14 +362,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
if @metadata.nil?
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
end
@@ -383,12 +385,140 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
return false if @metadata.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -412,6 +542,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details &&
metadata == o.metadata
@@ -426,7 +557,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details, metadata].hash
end
# Builds the object from hash
@@ -452,61 +583,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -523,24 +599,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/quantity.rb b/BillingApi/lib/pnap_billing_api/models/quantity.rb
new file mode 100644
index 00000000..93dbbccd
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/quantity.rb
@@ -0,0 +1,223 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ # Represents the quantity.
+ class Quantity < ApiModelBase
+ # Quantity size.
+ attr_accessor :quantity
+
+ attr_accessor :unit
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'quantity' => :'quantity',
+ :'unit' => :'unit'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'quantity' => :'Float',
+ :'unit' => :'QuantityUnitEnum'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::Quantity` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Quantity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'quantity')
+ self.quantity = attributes[:'quantity']
+ else
+ self.quantity = nil
+ end
+
+ if attributes.key?(:'unit')
+ self.unit = attributes[:'unit']
+ else
+ self.unit = 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 @quantity.nil?
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
+ end
+
+ if @quantity < 1
+ invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
+ end
+
+ if @unit.nil?
+ invalid_properties.push('invalid value for "unit", unit cannot be nil.')
+ end
+
+ 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'
+ return false if @quantity.nil?
+ return false if @quantity < 1
+ return false if @unit.nil?
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ if quantity < 1
+ fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit Value to be assigned
+ def unit=(unit)
+ if unit.nil?
+ fail ArgumentError, 'unit cannot be nil'
+ end
+
+ @unit = unit
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ quantity == o.quantity &&
+ unit == o.unit
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [quantity, unit].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/quantity_unit_enum.rb b/BillingApi/lib/pnap_billing_api/models/quantity_unit_enum.rb
new file mode 100644
index 00000000..b278bc4a
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/quantity_unit_enum.rb
@@ -0,0 +1,40 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ class QuantityUnitEnum
+ TB = "TB".freeze
+ COUNT = "COUNT".freeze
+
+ def self.all_vars
+ @all_vars ||= [TB, COUNT].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if QuantityUnitEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #QuantityUnitEnum"
+ end
+ end
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb b/BillingApi/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb
index 1244d28e..b19bccd5 100644
--- a/BillingApi/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb
+++ b/BillingApi/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -60,5 +60,4 @@ def build(data)
end
end
end
-
end
diff --git a/BillingApi/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb b/BillingApi/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb
index a98283cb..ba451aa4 100644
--- a/BillingApi/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/rated_usage_record.rb b/BillingApi/lib/pnap_billing_api/models/rated_usage_record.rb
index 672dabb4..aefbc958 100644
--- a/BillingApi/lib/pnap_billing_api/models/rated_usage_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/rated_usage_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Rated usage record.
- class RatedUsageRecord
+ class RatedUsageRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -68,6 +68,8 @@ class RatedUsageRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -115,14 +117,20 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -146,6 +154,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array'
}
@@ -165,9 +174,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::RatedUsageRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::RatedUsageRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -258,20 +268,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -336,14 +346,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
invalid_properties
end
@@ -363,11 +365,129 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -391,6 +511,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details
end
@@ -404,7 +525,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details].hash
end
# Builds the object from hash
@@ -430,61 +551,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -501,24 +567,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation.rb b/BillingApi/lib/pnap_billing_api/models/reservation.rb
index 07496e5b..ba923cbe 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,11 +15,11 @@
module BillingApi
# Reservation details
- class Reservation
+ class Reservation < ApiModelBase
# The reservation identifier.
attr_accessor :id
- # The code identifying the product. This code has significant across all locations.
+ # The code identifying the product. The same code is used for this product across all locations.
attr_accessor :product_code
attr_accessor :product_category
@@ -28,8 +28,14 @@ class Reservation
attr_accessor :reservation_model
+ attr_accessor :term
+
+ attr_accessor :reservation_state
+
attr_accessor :initial_invoice_model
+ attr_accessor :quantity
+
# The point in time (in UTC) when the reservation starts.
attr_accessor :start_date_time
@@ -59,6 +65,8 @@ class Reservation
# Next billing date for Reservation.
attr_accessor :next_billing_date
+ attr_accessor :utilization
+
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
@@ -89,7 +97,10 @@ def self.attribute_map
:'product_category' => :'productCategory',
:'location' => :'location',
:'reservation_model' => :'reservationModel',
+ :'term' => :'term',
+ :'reservation_state' => :'reservationState',
:'initial_invoice_model' => :'initialInvoiceModel',
+ :'quantity' => :'quantity',
:'start_date_time' => :'startDateTime',
:'end_date_time' => :'endDateTime',
:'last_renewal_date_time' => :'lastRenewalDateTime',
@@ -99,13 +110,19 @@ def self.attribute_map
:'price' => :'price',
:'price_unit' => :'priceUnit',
:'assigned_resource_id' => :'assignedResourceId',
- :'next_billing_date' => :'nextBillingDate'
+ :'next_billing_date' => :'nextBillingDate',
+ :'utilization' => :'utilization'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -116,7 +133,10 @@ def self.openapi_types
:'product_category' => :'ReservationProductCategoryEnum',
:'location' => :'LocationEnum',
:'reservation_model' => :'ReservationModelEnum',
+ :'term' => :'ReservationTerm',
+ :'reservation_state' => :'ReservationStateEnum',
:'initial_invoice_model' => :'ReservationInvoicingModelEnum',
+ :'quantity' => :'Quantity',
:'start_date_time' => :'Time',
:'end_date_time' => :'Time',
:'last_renewal_date_time' => :'Time',
@@ -126,7 +146,8 @@ def self.openapi_types
:'price' => :'Float',
:'price_unit' => :'PriceUnitEnum',
:'assigned_resource_id' => :'String',
- :'next_billing_date' => :'Date'
+ :'next_billing_date' => :'Date',
+ :'utilization' => :'Utilization'
}
end
@@ -144,9 +165,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Reservation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Reservation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -181,10 +203,26 @@ def initialize(attributes = {})
self.reservation_model = nil
end
+ if attributes.key?(:'term')
+ self.term = attributes[:'term']
+ end
+
+ if attributes.key?(:'reservation_state')
+ self.reservation_state = attributes[:'reservation_state']
+ else
+ self.reservation_state = nil
+ end
+
if attributes.key?(:'initial_invoice_model')
self.initial_invoice_model = attributes[:'initial_invoice_model']
end
+ if attributes.key?(:'quantity')
+ self.quantity = attributes[:'quantity']
+ else
+ self.quantity = nil
+ end
+
if attributes.key?(:'start_date_time')
self.start_date_time = attributes[:'start_date_time']
else
@@ -234,6 +272,10 @@ def initialize(attributes = {})
if attributes.key?(:'next_billing_date')
self.next_billing_date = attributes[:'next_billing_date']
end
+
+ if attributes.key?(:'utilization')
+ self.utilization = attributes[:'utilization']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -261,6 +303,14 @@ def list_invalid_properties
invalid_properties.push('invalid value for "reservation_model", reservation_model cannot be nil.')
end
+ if @reservation_state.nil?
+ invalid_properties.push('invalid value for "reservation_state", reservation_state cannot be nil.')
+ end
+
+ if @quantity.nil?
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
+ end
+
if @start_date_time.nil?
invalid_properties.push('invalid value for "start_date_time", start_date_time cannot be nil.')
end
@@ -293,6 +343,8 @@ def valid?
return false if @product_category.nil?
return false if @location.nil?
return false if @reservation_model.nil?
+ return false if @reservation_state.nil?
+ return false if @quantity.nil?
return false if @start_date_time.nil?
return false if @auto_renew.nil?
return false if @sku.nil?
@@ -301,6 +353,126 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] reservation_model Value to be assigned
+ def reservation_model=(reservation_model)
+ if reservation_model.nil?
+ fail ArgumentError, 'reservation_model cannot be nil'
+ end
+
+ @reservation_model = reservation_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] reservation_state Value to be assigned
+ def reservation_state=(reservation_state)
+ if reservation_state.nil?
+ fail ArgumentError, 'reservation_state cannot be nil'
+ end
+
+ @reservation_state = reservation_state
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] auto_renew Value to be assigned
+ def auto_renew=(auto_renew)
+ if auto_renew.nil?
+ fail ArgumentError, 'auto_renew cannot be nil'
+ end
+
+ @auto_renew = auto_renew
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] sku Value to be assigned
+ def sku=(sku)
+ if sku.nil?
+ fail ArgumentError, 'sku cannot be nil'
+ end
+
+ @sku = sku
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price Value to be assigned
+ def price=(price)
+ if price.nil?
+ fail ArgumentError, 'price cannot be nil'
+ end
+
+ @price = price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_unit Value to be assigned
+ def price_unit=(price_unit)
+ if price_unit.nil?
+ fail ArgumentError, 'price_unit cannot be nil'
+ end
+
+ @price_unit = price_unit
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -311,7 +483,10 @@ def ==(o)
product_category == o.product_category &&
location == o.location &&
reservation_model == o.reservation_model &&
+ term == o.term &&
+ reservation_state == o.reservation_state &&
initial_invoice_model == o.initial_invoice_model &&
+ quantity == o.quantity &&
start_date_time == o.start_date_time &&
end_date_time == o.end_date_time &&
last_renewal_date_time == o.last_renewal_date_time &&
@@ -321,7 +496,8 @@ def ==(o)
price == o.price &&
price_unit == o.price_unit &&
assigned_resource_id == o.assigned_resource_id &&
- next_billing_date == o.next_billing_date
+ next_billing_date == o.next_billing_date &&
+ utilization == o.utilization
end
# @see the `==` method
@@ -333,7 +509,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_code, product_category, location, reservation_model, initial_invoice_model, start_date_time, end_date_time, last_renewal_date_time, next_renewal_date_time, auto_renew, sku, price, price_unit, assigned_resource_id, next_billing_date].hash
+ [id, product_code, product_category, location, reservation_model, term, reservation_state, initial_invoice_model, quantity, start_date_time, end_date_time, last_renewal_date_time, next_renewal_date_time, auto_renew, sku, price, price_unit, assigned_resource_id, next_billing_date, utilization].hash
end
# Builds the object from hash
@@ -359,61 +535,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -430,24 +551,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb b/BillingApi/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb
index 3e90d103..8f3a514d 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Disabling auto-renewal for reservation request.
- class ReservationAutoRenewDisableRequest
+ class ReservationAutoRenewDisableRequest < ApiModelBase
attr_accessor :auto_renew_disable_reason
# Attribute mapping from ruby-style variable name to JSON key.
@@ -25,9 +25,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -51,9 +56,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationAutoRenewDisableRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationAutoRenewDisableRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -121,61 +127,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -192,24 +143,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_details.rb b/BillingApi/lib/pnap_billing_api/models/reservation_details.rb
new file mode 100644
index 00000000..1e367b2e
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_details.rb
@@ -0,0 +1,158 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ # Details of a Reservation entry inside Rated Usage.
+ class ReservationDetails < ApiModelBase
+ # The Reservation identifier.
+ attr_accessor :id
+
+ attr_accessor :quantity
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'id' => :'id',
+ :'quantity' => :'quantity'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'id' => :'String',
+ :'quantity' => :'Quantity'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::ReservationDetails` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'id')
+ self.id = attributes[:'id']
+ end
+
+ if attributes.key?(:'quantity')
+ self.quantity = attributes[:'quantity']
+ 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
+ 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
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ id == o.id &&
+ quantity == o.quantity
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [id, quantity].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb b/BillingApi/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb
index 2a1c4030..f94dcbc6 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_model_enum.rb b/BillingApi/lib/pnap_billing_api/models/reservation_model_enum.rb
index ec90c6ed..dd56430a 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation_model_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_model_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -19,10 +19,11 @@ class ReservationModelEnum
TWELVE_MONTHS_RESERVATION = "TWELVE_MONTHS_RESERVATION".freeze
TWENTY_FOUR_MONTHS_RESERVATION = "TWENTY_FOUR_MONTHS_RESERVATION".freeze
THIRTY_SIX_MONTHS_RESERVATION = "THIRTY_SIX_MONTHS_RESERVATION".freeze
+ CUSTOM_TERM = "CUSTOM_TERM".freeze
FREE_TIER = "FREE_TIER".freeze
def self.all_vars
- @all_vars ||= [ONE_MONTH_RESERVATION, TWELVE_MONTHS_RESERVATION, TWENTY_FOUR_MONTHS_RESERVATION, THIRTY_SIX_MONTHS_RESERVATION, FREE_TIER].freeze
+ @all_vars ||= [ONE_MONTH_RESERVATION, TWELVE_MONTHS_RESERVATION, TWENTY_FOUR_MONTHS_RESERVATION, THIRTY_SIX_MONTHS_RESERVATION, CUSTOM_TERM, FREE_TIER].freeze
end
# Builds the enum from string
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_product_category_enum.rb b/BillingApi/lib/pnap_billing_api/models/reservation_product_category_enum.rb
index 1227d438..9d727079 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation_product_category_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_product_category_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -17,9 +17,10 @@ module BillingApi
class ReservationProductCategoryEnum
SERVER = "server".freeze
BANDWIDTH = "bandwidth".freeze
+ STORAGE = "storage".freeze
def self.all_vars
- @all_vars ||= [SERVER, BANDWIDTH].freeze
+ @all_vars ||= [SERVER, BANDWIDTH, STORAGE].freeze
end
# Builds the enum from string
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_request.rb b/BillingApi/lib/pnap_billing_api/models/reservation_request.rb
index 98fbd451..86af5d30 100644
--- a/BillingApi/lib/pnap_billing_api/models/reservation_request.rb
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_request.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,26 +15,35 @@
module BillingApi
# Reservation request.
- class ReservationRequest
+ class ReservationRequest < ApiModelBase
# The sku code of product pricing plan.
attr_accessor :sku
+ attr_accessor :quantity
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
- :'sku' => :'sku'
+ :'sku' => :'sku',
+ :'quantity' => :'quantity'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
def self.openapi_types
{
- :'sku' => :'String'
+ :'sku' => :'String',
+ :'quantity' => :'Quantity'
}
end
@@ -52,9 +61,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -64,6 +74,12 @@ def initialize(attributes = {})
else
self.sku = nil
end
+
+ if attributes.key?(:'quantity')
+ self.quantity = attributes[:'quantity']
+ else
+ self.quantity = nil
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -75,6 +91,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "sku", sku cannot be nil.')
end
+ if @quantity.nil?
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
+ end
+
invalid_properties
end
@@ -83,15 +103,37 @@ def list_invalid_properties
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @sku.nil?
+ return false if @quantity.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] sku Value to be assigned
+ def sku=(sku)
+ if sku.nil?
+ fail ArgumentError, 'sku cannot be nil'
+ end
+
+ @sku = sku
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
- sku == o.sku
+ sku == o.sku &&
+ quantity == o.quantity
end
# @see the `==` method
@@ -103,7 +145,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [sku].hash
+ [sku, quantity].hash
end
# Builds the object from hash
@@ -129,61 +171,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -200,24 +187,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_state_enum.rb b/BillingApi/lib/pnap_billing_api/models/reservation_state_enum.rb
new file mode 100644
index 00000000..2766765e
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_state_enum.rb
@@ -0,0 +1,44 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ class ReservationStateEnum
+ REQUESTED = "REQUESTED".freeze
+ DECLINED = "DECLINED".freeze
+ IN_REVIEW = "IN_REVIEW".freeze
+ SETTING_UP = "SETTING_UP".freeze
+ ACTIVE = "ACTIVE".freeze
+ EXPIRED = "EXPIRED".freeze
+
+ def self.all_vars
+ @all_vars ||= [REQUESTED, DECLINED, IN_REVIEW, SETTING_UP, ACTIVE, EXPIRED].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if ReservationStateEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #ReservationStateEnum"
+ end
+ end
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/reservation_term.rb b/BillingApi/lib/pnap_billing_api/models/reservation_term.rb
new file mode 100644
index 00000000..20f5a784
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/reservation_term.rb
@@ -0,0 +1,214 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ # The Reservation term.
+ class ReservationTerm < ApiModelBase
+ # Term's length, expressed in months.
+ attr_accessor :length_in_months
+
+ attr_accessor :reservation_model
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'length_in_months' => :'lengthInMonths',
+ :'reservation_model' => :'reservationModel'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'length_in_months' => :'Integer',
+ :'reservation_model' => :'ReservationModelEnum'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::ReservationTerm` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ReservationTerm`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'length_in_months')
+ self.length_in_months = attributes[:'length_in_months']
+ else
+ self.length_in_months = nil
+ end
+
+ if attributes.key?(:'reservation_model')
+ self.reservation_model = attributes[:'reservation_model']
+ else
+ self.reservation_model = 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 @length_in_months.nil?
+ invalid_properties.push('invalid value for "length_in_months", length_in_months cannot be nil.')
+ end
+
+ if @reservation_model.nil?
+ invalid_properties.push('invalid value for "reservation_model", reservation_model cannot be nil.')
+ end
+
+ 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'
+ return false if @length_in_months.nil?
+ return false if @reservation_model.nil?
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] length_in_months Value to be assigned
+ def length_in_months=(length_in_months)
+ if length_in_months.nil?
+ fail ArgumentError, 'length_in_months cannot be nil'
+ end
+
+ @length_in_months = length_in_months
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] reservation_model Value to be assigned
+ def reservation_model=(reservation_model)
+ if reservation_model.nil?
+ fail ArgumentError, 'reservation_model cannot be nil'
+ end
+
+ @reservation_model = reservation_model
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ length_in_months == o.length_in_months &&
+ reservation_model == o.reservation_model
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [length_in_months, reservation_model].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/models/server_details.rb b/BillingApi/lib/pnap_billing_api/models/server_details.rb
index 2defd78f..0f6e0267 100644
--- a/BillingApi/lib/pnap_billing_api/models/server_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/server_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of the server associated with this rated usage record.
- class ServerDetails
+ class ServerDetails < ApiModelBase
# The server identifier as returned by the BMC API.
attr_accessor :id
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -102,6 +108,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] hostname Value to be assigned
+ def hostname=(hostname)
+ if hostname.nil?
+ fail ArgumentError, 'hostname cannot be nil'
+ end
+
+ @hostname = hostname
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -146,61 +172,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -217,24 +188,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/server_product.rb b/BillingApi/lib/pnap_billing_api/models/server_product.rb
index a1fc1706..130ceb7a 100644
--- a/BillingApi/lib/pnap_billing_api/models/server_product.rb
+++ b/BillingApi/lib/pnap_billing_api/models/server_product.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class ServerProduct
+ class ServerProduct < ApiModelBase
# The code identifying the product. This code has significant across all locations.
attr_accessor :product_code
@@ -36,9 +36,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -72,9 +77,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerProduct`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerProduct`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -134,6 +140,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -180,61 +216,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -251,24 +232,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/server_product_metadata.rb b/BillingApi/lib/pnap_billing_api/models/server_product_metadata.rb
index 2d8fc002..fcb793c8 100644
--- a/BillingApi/lib/pnap_billing_api/models/server_product_metadata.rb
+++ b/BillingApi/lib/pnap_billing_api/models/server_product_metadata.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of the server product.
- class ServerProductMetadata
+ class ServerProductMetadata < ApiModelBase
# RAM in GB.
attr_accessor :ram_in_gb
@@ -54,9 +54,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -87,9 +92,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerProductMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerProductMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -193,6 +199,76 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] ram_in_gb Value to be assigned
+ def ram_in_gb=(ram_in_gb)
+ if ram_in_gb.nil?
+ fail ArgumentError, 'ram_in_gb cannot be nil'
+ end
+
+ @ram_in_gb = ram_in_gb
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cpu Value to be assigned
+ def cpu=(cpu)
+ if cpu.nil?
+ fail ArgumentError, 'cpu cannot be nil'
+ end
+
+ @cpu = cpu
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cpu_count Value to be assigned
+ def cpu_count=(cpu_count)
+ if cpu_count.nil?
+ fail ArgumentError, 'cpu_count cannot be nil'
+ end
+
+ @cpu_count = cpu_count
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cores_per_cpu Value to be assigned
+ def cores_per_cpu=(cores_per_cpu)
+ if cores_per_cpu.nil?
+ fail ArgumentError, 'cores_per_cpu cannot be nil'
+ end
+
+ @cores_per_cpu = cores_per_cpu
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cpu_frequency Value to be assigned
+ def cpu_frequency=(cpu_frequency)
+ if cpu_frequency.nil?
+ fail ArgumentError, 'cpu_frequency cannot be nil'
+ end
+
+ @cpu_frequency = cpu_frequency
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] network Value to be assigned
+ def network=(network)
+ if network.nil?
+ fail ArgumentError, 'network cannot be nil'
+ end
+
+ @network = network
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] storage Value to be assigned
+ def storage=(storage)
+ if storage.nil?
+ fail ArgumentError, 'storage cannot be nil'
+ end
+
+ @storage = storage
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -243,61 +319,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -314,24 +335,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/server_record.rb b/BillingApi/lib/pnap_billing_api/models/server_record.rb
index 1e5bd6b7..00ae09ef 100644
--- a/BillingApi/lib/pnap_billing_api/models/server_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/server_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class ServerRecord
+ class ServerRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -67,6 +67,8 @@ class ServerRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -116,15 +118,21 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails',
:'metadata' => :'metadata'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -148,6 +156,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array',
:'metadata' => :'ServerDetails'
@@ -175,9 +184,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ServerRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -268,20 +278,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -352,14 +362,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
if @metadata.nil?
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
end
@@ -383,12 +385,140 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
return false if @metadata.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -412,6 +542,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details &&
metadata == o.metadata
@@ -426,7 +557,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details, metadata].hash
end
# Builds the object from hash
@@ -452,61 +583,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -523,24 +599,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/storage_details.rb b/BillingApi/lib/pnap_billing_api/models/storage_details.rb
index 4a530acf..b2d11d7a 100644
--- a/BillingApi/lib/pnap_billing_api/models/storage_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/storage_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Details of the storage associated with this rated usage record.
- class StorageDetails
+ class StorageDetails < ApiModelBase
# Network storage ID.
attr_accessor :network_storage_id
@@ -46,9 +46,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -77,35 +82,28 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::StorageDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::StorageDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
if attributes.key?(:'network_storage_id')
self.network_storage_id = attributes[:'network_storage_id']
- else
- self.network_storage_id = nil
end
if attributes.key?(:'network_storage_name')
self.network_storage_name = attributes[:'network_storage_name']
- else
- self.network_storage_name = nil
end
if attributes.key?(:'volume_id')
self.volume_id = attributes[:'volume_id']
- else
- self.volume_id = nil
end
if attributes.key?(:'volume_name')
self.volume_name = attributes[:'volume_name']
- else
- self.volume_name = nil
end
if attributes.key?(:'capacity_in_gb')
@@ -116,8 +114,6 @@ def initialize(attributes = {})
if attributes.key?(:'created_on')
self.created_on = attributes[:'created_on']
- else
- self.created_on = nil
end
end
@@ -126,30 +122,10 @@ def initialize(attributes = {})
def list_invalid_properties
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
invalid_properties = Array.new
- if @network_storage_id.nil?
- invalid_properties.push('invalid value for "network_storage_id", network_storage_id cannot be nil.')
- end
-
- if @network_storage_name.nil?
- invalid_properties.push('invalid value for "network_storage_name", network_storage_name cannot be nil.')
- end
-
- if @volume_id.nil?
- invalid_properties.push('invalid value for "volume_id", volume_id cannot be nil.')
- end
-
- if @volume_name.nil?
- invalid_properties.push('invalid value for "volume_name", volume_name cannot be nil.')
- end
-
if @capacity_in_gb.nil?
invalid_properties.push('invalid value for "capacity_in_gb", capacity_in_gb cannot be nil.')
end
- if @created_on.nil?
- invalid_properties.push('invalid value for "created_on", created_on cannot be nil.')
- end
-
invalid_properties
end
@@ -157,15 +133,20 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
- return false if @network_storage_id.nil?
- return false if @network_storage_name.nil?
- return false if @volume_id.nil?
- return false if @volume_name.nil?
return false if @capacity_in_gb.nil?
- return false if @created_on.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] capacity_in_gb Value to be assigned
+ def capacity_in_gb=(capacity_in_gb)
+ if capacity_in_gb.nil?
+ fail ArgumentError, 'capacity_in_gb cannot be nil'
+ end
+
+ @capacity_in_gb = capacity_in_gb
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -214,61 +195,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -285,24 +211,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/storage_record.rb b/BillingApi/lib/pnap_billing_api/models/storage_record.rb
index e4cf2809..39003848 100644
--- a/BillingApi/lib/pnap_billing_api/models/storage_record.rb
+++ b/BillingApi/lib/pnap_billing_api/models/storage_record.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class StorageRecord
+ class StorageRecord < ApiModelBase
# The unique identifier of the rated usage record.
attr_accessor :id
@@ -67,6 +67,8 @@ class StorageRecord
# Reservation id associated with this rated usage record.
attr_accessor :reservation_id
+ attr_accessor :reservation_details
+
attr_accessor :discount_details
attr_accessor :credit_details
@@ -116,15 +118,21 @@ def self.attribute_map
:'usage_session_id' => :'usageSessionId',
:'correlation_id' => :'correlationId',
:'reservation_id' => :'reservationId',
+ :'reservation_details' => :'reservationDetails',
:'discount_details' => :'discountDetails',
:'credit_details' => :'creditDetails',
:'metadata' => :'metadata'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -148,6 +156,7 @@ def self.openapi_types
:'usage_session_id' => :'String',
:'correlation_id' => :'String',
:'reservation_id' => :'String',
+ :'reservation_details' => :'ReservationDetails',
:'discount_details' => :'ApplicableDiscountDetails',
:'credit_details' => :'Array',
:'metadata' => :'StorageDetails'
@@ -175,9 +184,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::StorageRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::StorageRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -268,20 +278,20 @@ def initialize(attributes = {})
if attributes.key?(:'usage_session_id')
self.usage_session_id = attributes[:'usage_session_id']
- else
- self.usage_session_id = nil
end
if attributes.key?(:'correlation_id')
self.correlation_id = attributes[:'correlation_id']
- else
- self.correlation_id = nil
end
if attributes.key?(:'reservation_id')
self.reservation_id = attributes[:'reservation_id']
end
+ if attributes.key?(:'reservation_details')
+ self.reservation_details = attributes[:'reservation_details']
+ end
+
if attributes.key?(:'discount_details')
self.discount_details = attributes[:'discount_details']
end
@@ -352,14 +362,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "active", active cannot be nil.')
end
- if @usage_session_id.nil?
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
- end
-
- if @correlation_id.nil?
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
- end
-
if @metadata.nil?
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
end
@@ -383,12 +385,140 @@ def valid?
return false if @unit_price_description.nil?
return false if @quantity.nil?
return false if @active.nil?
- return false if @usage_session_id.nil?
- return false if @correlation_id.nil?
return false if @metadata.nil?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_category Value to be assigned
+ def product_category=(product_category)
+ if product_category.nil?
+ fail ArgumentError, 'product_category cannot be nil'
+ end
+
+ @product_category = product_category
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] product_code Value to be assigned
+ def product_code=(product_code)
+ if product_code.nil?
+ fail ArgumentError, 'product_code cannot be nil'
+ end
+
+ @product_code = product_code
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] start_date_time Value to be assigned
+ def start_date_time=(start_date_time)
+ if start_date_time.nil?
+ fail ArgumentError, 'start_date_time cannot be nil'
+ end
+
+ @start_date_time = start_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] end_date_time Value to be assigned
+ def end_date_time=(end_date_time)
+ if end_date_time.nil?
+ fail ArgumentError, 'end_date_time cannot be nil'
+ end
+
+ @end_date_time = end_date_time
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cost Value to be assigned
+ def cost=(cost)
+ if cost.nil?
+ fail ArgumentError, 'cost cannot be nil'
+ end
+
+ @cost = cost
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] price_model Value to be assigned
+ def price_model=(price_model)
+ if price_model.nil?
+ fail ArgumentError, 'price_model cannot be nil'
+ end
+
+ @price_model = price_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price Value to be assigned
+ def unit_price=(unit_price)
+ if unit_price.nil?
+ fail ArgumentError, 'unit_price cannot be nil'
+ end
+
+ @unit_price = unit_price
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] unit_price_description Value to be assigned
+ def unit_price_description=(unit_price_description)
+ if unit_price_description.nil?
+ fail ArgumentError, 'unit_price_description cannot be nil'
+ end
+
+ @unit_price_description = unit_price_description
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] active Value to be assigned
+ def active=(active)
+ if active.nil?
+ fail ArgumentError, 'active cannot be nil'
+ end
+
+ @active = active
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] metadata Value to be assigned
+ def metadata=(metadata)
+ if metadata.nil?
+ fail ArgumentError, 'metadata cannot be nil'
+ end
+
+ @metadata = metadata
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -412,6 +542,7 @@ def ==(o)
usage_session_id == o.usage_session_id &&
correlation_id == o.correlation_id &&
reservation_id == o.reservation_id &&
+ reservation_details == o.reservation_details &&
discount_details == o.discount_details &&
credit_details == o.credit_details &&
metadata == o.metadata
@@ -426,7 +557,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, reservation_details, discount_details, credit_details, metadata].hash
end
# Builds the object from hash
@@ -452,61 +583,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -523,24 +599,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/system_credit_cause_enum.rb b/BillingApi/lib/pnap_billing_api/models/system_credit_cause_enum.rb
index e502522e..06f336a9 100644
--- a/BillingApi/lib/pnap_billing_api/models/system_credit_cause_enum.rb
+++ b/BillingApi/lib/pnap_billing_api/models/system_credit_cause_enum.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/lib/pnap_billing_api/models/system_credit_details.rb b/BillingApi/lib/pnap_billing_api/models/system_credit_details.rb
index 3190f4ed..7f11491a 100644
--- a/BillingApi/lib/pnap_billing_api/models/system_credit_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/system_credit_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BillingApi
- class SystemCreditDetails
+ class SystemCreditDetails < ApiModelBase
# Amount applied.
attr_accessor :applied_amount
@@ -53,9 +53,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -88,9 +93,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::SystemCreditDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::SystemCreditDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -144,6 +150,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] applied_amount Value to be assigned
+ def applied_amount=(applied_amount)
+ if applied_amount.nil?
+ fail ArgumentError, 'applied_amount cannot be nil'
+ end
+
+ @applied_amount = applied_amount
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cause Value to be assigned
+ def cause=(cause)
+ if cause.nil?
+ fail ArgumentError, 'cause cannot be nil'
+ end
+
+ @cause = cause
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -189,61 +225,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -260,24 +241,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/threshold_configuration_details.rb b/BillingApi/lib/pnap_billing_api/models/threshold_configuration_details.rb
index 652f75a1..3e5039dd 100644
--- a/BillingApi/lib/pnap_billing_api/models/threshold_configuration_details.rb
+++ b/BillingApi/lib/pnap_billing_api/models/threshold_configuration_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BillingApi
# Threshold billing configuration.
- class ThresholdConfigurationDetails
+ class ThresholdConfigurationDetails < ApiModelBase
# Threshold billing amount.
attr_accessor :threshold_amount
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ThresholdConfigurationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::ThresholdConfigurationDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -86,6 +92,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] threshold_amount Value to be assigned
+ def threshold_amount=(threshold_amount)
+ if threshold_amount.nil?
+ fail ArgumentError, 'threshold_amount cannot be nil'
+ end
+
+ @threshold_amount = threshold_amount
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -129,61 +145,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BillingApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -200,24 +161,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BillingApi/lib/pnap_billing_api/models/utilization.rb b/BillingApi/lib/pnap_billing_api/models/utilization.rb
new file mode 100644
index 00000000..4c54ba86
--- /dev/null
+++ b/BillingApi/lib/pnap_billing_api/models/utilization.rb
@@ -0,0 +1,208 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BillingApi
+ class Utilization < ApiModelBase
+ attr_accessor :quantity
+
+ attr_accessor :percentage
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'quantity' => :'quantity',
+ :'percentage' => :'percentage'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'quantity' => :'Quantity',
+ :'percentage' => :'Float'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::Utilization` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::Utilization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'quantity')
+ self.quantity = attributes[:'quantity']
+ else
+ self.quantity = nil
+ end
+
+ if attributes.key?(:'percentage')
+ self.percentage = attributes[:'percentage']
+ else
+ self.percentage = 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 @quantity.nil?
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
+ end
+
+ if @percentage.nil?
+ invalid_properties.push('invalid value for "percentage", percentage cannot be nil.')
+ end
+
+ if @percentage > 100
+ invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.')
+ end
+
+ if @percentage < 0
+ invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.')
+ end
+
+ 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'
+ return false if @quantity.nil?
+ return false if @percentage.nil?
+ return false if @percentage > 100
+ return false if @percentage < 0
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] quantity Value to be assigned
+ def quantity=(quantity)
+ if quantity.nil?
+ fail ArgumentError, 'quantity cannot be nil'
+ end
+
+ @quantity = quantity
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] percentage Value to be assigned
+ def percentage=(percentage)
+ if percentage.nil?
+ fail ArgumentError, 'percentage cannot be nil'
+ end
+
+ if percentage > 100
+ fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.'
+ end
+
+ if percentage < 0
+ fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.'
+ end
+
+ @percentage = percentage
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ quantity == o.quantity &&
+ percentage == o.percentage
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [quantity, percentage].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BillingApi/lib/pnap_billing_api/version.rb b/BillingApi/lib/pnap_billing_api/version.rb
index a63f0b3e..85c40878 100644
--- a/BillingApi/lib/pnap_billing_api/version.rb
+++ b/BillingApi/lib/pnap_billing_api/version.rb
@@ -6,8 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
-
+Generator version: 7.20.0
=end
def get_version()
diff --git a/BillingApi/pnap_billing_api.gemspec b/BillingApi/pnap_billing_api.gemspec
index be4e9610..dd4799ac 100644
--- a/BillingApi/pnap_billing_api.gemspec
+++ b/BillingApi/pnap_billing_api.gemspec
@@ -8,7 +8,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -19,14 +19,14 @@ Gem::Specification.new do |s|
s.name = "pnap_billing_api"
s.version = BillingApi::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["PhoenixNAP"]
+ s.authors = ["OpenAPI-Generator"]
s.email = ["support@phoenixnap.com"]
- s.homepage = "https://phoenixnap.com/bare-metal-cloud"
+ s.homepage = "https://openapi-generator.tech"
s.summary = "Billing API Ruby Gem"
- s.description = "Billing API Ruby Gem"
+ s.description = "Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/) "
s.license = "MPL-2.0"
s.required_ruby_version = ">= 2.7"
- s.metadata = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
+ s.metadata = {}
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
@@ -36,4 +36,4 @@ Gem::Specification.new do |s|
s.test_files = `find spec/*`.split("\n")
s.executables = []
s.require_paths = ["lib"]
-end
+end
\ No newline at end of file
diff --git a/BillingApi/spec/api/billing_configurations_api_spec.rb b/BillingApi/spec/api/billing_configurations_api_spec.rb
index 74551b8b..d7d11602 100644
--- a/BillingApi/spec/api/billing_configurations_api_spec.rb
+++ b/BillingApi/spec/api/billing_configurations_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/api/product_availability_api_spec.rb b/BillingApi/spec/api/product_availability_api_spec.rb
index 06879c9c..19a42cd6 100644
--- a/BillingApi/spec/api/product_availability_api_spec.rb
+++ b/BillingApi/spec/api/product_availability_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -39,9 +39,9 @@
# @option opts [Array] :product_category Product category. Currently only SERVER category is supported.
# @option opts [Array] :product_code
# @option opts [Boolean] :show_only_min_quantity_available Show only locations where product with requested quantity is available or all locations where product is offered.
- # @option opts [Array] :location
+ # @option opts [Array] :location
# @option opts [Array] :solution
- # @option opts [Float] :min_quantity Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
+ # @option opts [Float] :min_quantity Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10.
# @return [Array]
describe 'product_availability_get test' do
it 'should work' do
diff --git a/BillingApi/spec/api/products_api_spec.rb b/BillingApi/spec/api/products_api_spec.rb
index babf419d..c30574d3 100644
--- a/BillingApi/spec/api/products_api_spec.rb
+++ b/BillingApi/spec/api/products_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/api/rated_usage_api_spec.rb b/BillingApi/spec/api/rated_usage_api_spec.rb
index 221447e8..f6a06252 100644
--- a/BillingApi/spec/api/rated_usage_api_spec.rb
+++ b/BillingApi/spec/api/rated_usage_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/api/reservations_api_spec.rb b/BillingApi/spec/api/reservations_api_spec.rb
index 12d01252..23d22f6d 100644
--- a/BillingApi/spec/api/reservations_api_spec.rb
+++ b/BillingApi/spec/api/reservations_api_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/models/applicable_discount_details_spec.rb b/BillingApi/spec/models/applicable_discount_details_spec.rb
index fd42d3e9..4d7d9273 100644
--- a/BillingApi/spec/models/applicable_discount_details_spec.rb
+++ b/BillingApi/spec/models/applicable_discount_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ApplicableDiscountDetails do
- let(:instance) { BillingApi::ApplicableDiscountDetails.new }
+ #let(:instance) { BillingApi::ApplicableDiscountDetails.new }
describe 'test an instance of ApplicableDiscountDetails' do
it 'should create an instance of ApplicableDiscountDetails' do
diff --git a/BillingApi/spec/models/applicable_discounts_spec.rb b/BillingApi/spec/models/applicable_discounts_spec.rb
index e093127f..abc03f4f 100644
--- a/BillingApi/spec/models/applicable_discounts_spec.rb
+++ b/BillingApi/spec/models/applicable_discounts_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ApplicableDiscounts do
- let(:instance) { BillingApi::ApplicableDiscounts.new }
+ #let(:instance) { BillingApi::ApplicableDiscounts.new }
describe 'test an instance of ApplicableDiscounts' do
it 'should create an instance of ApplicableDiscounts' do
diff --git a/BillingApi/spec/models/bandwidth_details_spec.rb b/BillingApi/spec/models/bandwidth_details_spec.rb
index fe8f9655..cab830c0 100644
--- a/BillingApi/spec/models/bandwidth_details_spec.rb
+++ b/BillingApi/spec/models/bandwidth_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::BandwidthDetails do
- let(:instance) { BillingApi::BandwidthDetails.new }
+ #let(:instance) { BillingApi::BandwidthDetails.new }
describe 'test an instance of BandwidthDetails' do
it 'should create an instance of BandwidthDetails' do
diff --git a/BillingApi/spec/models/bandwidth_record_spec.rb b/BillingApi/spec/models/bandwidth_record_spec.rb
index 8baa6a99..312b0e48 100644
--- a/BillingApi/spec/models/bandwidth_record_spec.rb
+++ b/BillingApi/spec/models/bandwidth_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::BandwidthRecord do
- let(:instance) { BillingApi::BandwidthRecord.new }
+ #let(:instance) { BillingApi::BandwidthRecord.new }
describe 'test an instance of BandwidthRecord' do
it 'should create an instance of BandwidthRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/configuration_details_spec.rb b/BillingApi/spec/models/configuration_details_spec.rb
index 2e016abd..aff6b32c 100644
--- a/BillingApi/spec/models/configuration_details_spec.rb
+++ b/BillingApi/spec/models/configuration_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ConfigurationDetails do
- let(:instance) { BillingApi::ConfigurationDetails.new }
+ #let(:instance) { BillingApi::ConfigurationDetails.new }
describe 'test an instance of ConfigurationDetails' do
it 'should create an instance of ConfigurationDetails' do
diff --git a/BillingApi/spec/models/credit_details_base_spec.rb b/BillingApi/spec/models/credit_details_base_spec.rb
index 0dfc8c95..23ae2eae 100644
--- a/BillingApi/spec/models/credit_details_base_spec.rb
+++ b/BillingApi/spec/models/credit_details_base_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::CreditDetailsBase do
- let(:instance) { BillingApi::CreditDetailsBase.new }
+ #let(:instance) { BillingApi::CreditDetailsBase.new }
describe 'test an instance of CreditDetailsBase' do
it 'should create an instance of CreditDetailsBase' do
diff --git a/BillingApi/spec/models/credit_details_spec.rb b/BillingApi/spec/models/credit_details_spec.rb
index 7fa3e98d..b0b960c9 100644
--- a/BillingApi/spec/models/credit_details_spec.rb
+++ b/BillingApi/spec/models/credit_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/models/credit_type_enum_spec.rb b/BillingApi/spec/models/credit_type_enum_spec.rb
index 32d5ec22..479159ef 100644
--- a/BillingApi/spec/models/credit_type_enum_spec.rb
+++ b/BillingApi/spec/models/credit_type_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::CreditTypeEnum do
- let(:instance) { BillingApi::CreditTypeEnum.new }
+ #let(:instance) { BillingApi::CreditTypeEnum.new }
describe 'test an instance of CreditTypeEnum' do
it 'should create an instance of CreditTypeEnum' do
diff --git a/BillingApi/spec/models/discount_details_spec.rb b/BillingApi/spec/models/discount_details_spec.rb
index 42f6159e..8715152b 100644
--- a/BillingApi/spec/models/discount_details_spec.rb
+++ b/BillingApi/spec/models/discount_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::DiscountDetails do
- let(:instance) { BillingApi::DiscountDetails.new }
+ #let(:instance) { BillingApi::DiscountDetails.new }
describe 'test an instance of DiscountDetails' do
it 'should create an instance of DiscountDetails' do
diff --git a/BillingApi/spec/models/discount_type_enum_spec.rb b/BillingApi/spec/models/discount_type_enum_spec.rb
index a5452c16..628f9513 100644
--- a/BillingApi/spec/models/discount_type_enum_spec.rb
+++ b/BillingApi/spec/models/discount_type_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::DiscountTypeEnum do
- let(:instance) { BillingApi::DiscountTypeEnum.new }
+ #let(:instance) { BillingApi::DiscountTypeEnum.new }
describe 'test an instance of DiscountTypeEnum' do
it 'should create an instance of DiscountTypeEnum' do
diff --git a/BillingApi/spec/models/error_spec.rb b/BillingApi/spec/models/error_spec.rb
index 22006856..4d3b7033 100644
--- a/BillingApi/spec/models/error_spec.rb
+++ b/BillingApi/spec/models/error_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::Error do
- let(:instance) { BillingApi::Error.new }
+ #let(:instance) { BillingApi::Error.new }
describe 'test an instance of Error' do
it 'should create an instance of Error' do
diff --git a/BillingApi/spec/models/gpu_configuration_metadata_spec.rb b/BillingApi/spec/models/gpu_configuration_metadata_spec.rb
index ed328625..a05e4b72 100644
--- a/BillingApi/spec/models/gpu_configuration_metadata_spec.rb
+++ b/BillingApi/spec/models/gpu_configuration_metadata_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::GpuConfigurationMetadata do
- let(:instance) { BillingApi::GpuConfigurationMetadata.new }
+ #let(:instance) { BillingApi::GpuConfigurationMetadata.new }
describe 'test an instance of GpuConfigurationMetadata' do
it 'should create an instance of GpuConfigurationMetadata' do
diff --git a/BillingApi/spec/models/location_availability_detail_spec.rb b/BillingApi/spec/models/location_availability_detail_spec.rb
index 9cdc685f..74278343 100644
--- a/BillingApi/spec/models/location_availability_detail_spec.rb
+++ b/BillingApi/spec/models/location_availability_detail_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::LocationAvailabilityDetail do
- let(:instance) { BillingApi::LocationAvailabilityDetail.new }
+ #let(:instance) { BillingApi::LocationAvailabilityDetail.new }
describe 'test an instance of LocationAvailabilityDetail' do
it 'should create an instance of LocationAvailabilityDetail' do
diff --git a/BillingApi/spec/models/location_enum_spec.rb b/BillingApi/spec/models/location_enum_spec.rb
index 914a757e..8da4ddd6 100644
--- a/BillingApi/spec/models/location_enum_spec.rb
+++ b/BillingApi/spec/models/location_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::LocationEnum do
- let(:instance) { BillingApi::LocationEnum.new }
+ #let(:instance) { BillingApi::LocationEnum.new }
describe 'test an instance of LocationEnum' do
it 'should create an instance of LocationEnum' do
diff --git a/BillingApi/spec/models/operating_system_details_spec.rb b/BillingApi/spec/models/operating_system_details_spec.rb
index ac4dd3e1..8dbb214a 100644
--- a/BillingApi/spec/models/operating_system_details_spec.rb
+++ b/BillingApi/spec/models/operating_system_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::OperatingSystemDetails do
- let(:instance) { BillingApi::OperatingSystemDetails.new }
+ #let(:instance) { BillingApi::OperatingSystemDetails.new }
describe 'test an instance of OperatingSystemDetails' do
it 'should create an instance of OperatingSystemDetails' do
diff --git a/BillingApi/spec/models/operating_system_record_spec.rb b/BillingApi/spec/models/operating_system_record_spec.rb
index e24dea7d..e4c48a7d 100644
--- a/BillingApi/spec/models/operating_system_record_spec.rb
+++ b/BillingApi/spec/models/operating_system_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::OperatingSystemRecord do
- let(:instance) { BillingApi::OperatingSystemRecord.new }
+ #let(:instance) { BillingApi::OperatingSystemRecord.new }
describe 'test an instance of OperatingSystemRecord' do
it 'should create an instance of OperatingSystemRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/package_details_spec.rb b/BillingApi/spec/models/package_details_spec.rb
new file mode 100644
index 00000000..5dec59fc
--- /dev/null
+++ b/BillingApi/spec/models/package_details_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::PackageDetails
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::PackageDetails do
+ #let(:instance) { BillingApi::PackageDetails.new }
+
+ describe 'test an instance of PackageDetails' do
+ it 'should create an instance of PackageDetails' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::PackageDetails)
+ end
+ end
+
+ describe 'test attribute "package_quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "package_unit"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/package_quantity_spec.rb b/BillingApi/spec/models/package_quantity_spec.rb
new file mode 100644
index 00000000..9124ffdb
--- /dev/null
+++ b/BillingApi/spec/models/package_quantity_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::PackageQuantity
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::PackageQuantity do
+ #let(:instance) { BillingApi::PackageQuantity.new }
+
+ describe 'test an instance of PackageQuantity' do
+ it 'should create an instance of PackageQuantity' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::PackageQuantity)
+ end
+ end
+
+ describe 'test attribute "min"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "max"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/package_unit_enum_spec.rb b/BillingApi/spec/models/package_unit_enum_spec.rb
index 9d15e6a9..0811c1e2 100644
--- a/BillingApi/spec/models/package_unit_enum_spec.rb
+++ b/BillingApi/spec/models/package_unit_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PackageUnitEnum do
- let(:instance) { BillingApi::PackageUnitEnum.new }
+ #let(:instance) { BillingApi::PackageUnitEnum.new }
describe 'test an instance of PackageUnitEnum' do
it 'should create an instance of PackageUnitEnum' do
diff --git a/BillingApi/spec/models/price_unit_enum_spec.rb b/BillingApi/spec/models/price_unit_enum_spec.rb
index 14a633c0..0052deaa 100644
--- a/BillingApi/spec/models/price_unit_enum_spec.rb
+++ b/BillingApi/spec/models/price_unit_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PriceUnitEnum do
- let(:instance) { BillingApi::PriceUnitEnum.new }
+ #let(:instance) { BillingApi::PriceUnitEnum.new }
describe 'test an instance of PriceUnitEnum' do
it 'should create an instance of PriceUnitEnum' do
diff --git a/BillingApi/spec/models/pricing_plan_spec.rb b/BillingApi/spec/models/pricing_plan_spec.rb
index 59fa05ac..f5e4737a 100644
--- a/BillingApi/spec/models/pricing_plan_spec.rb
+++ b/BillingApi/spec/models/pricing_plan_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PricingPlan do
- let(:instance) { BillingApi::PricingPlan.new }
+ #let(:instance) { BillingApi::PricingPlan.new }
describe 'test an instance of PricingPlan' do
it 'should create an instance of PricingPlan' do
@@ -42,7 +42,7 @@
describe 'test attribute "location"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "AUS", "GLOBAL"])
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PHX", "ASH", "NLD", "SGP", "CHI", "SEA", "GLOBAL"])
# validator.allowable_values.each do |value|
# expect { instance.location = value }.not_to raise_error
# end
@@ -95,4 +95,10 @@
end
end
+ describe 'test attribute "package_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
end
diff --git a/BillingApi/spec/models/product_availability_spec.rb b/BillingApi/spec/models/product_availability_spec.rb
index 8a6ff123..326e411d 100644
--- a/BillingApi/spec/models/product_availability_spec.rb
+++ b/BillingApi/spec/models/product_availability_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ProductAvailability do
- let(:instance) { BillingApi::ProductAvailability.new }
+ #let(:instance) { BillingApi::ProductAvailability.new }
describe 'test an instance of ProductAvailability' do
it 'should create an instance of ProductAvailability' do
diff --git a/BillingApi/spec/models/product_category_enum_spec.rb b/BillingApi/spec/models/product_category_enum_spec.rb
index 664fec8f..e6a817c4 100644
--- a/BillingApi/spec/models/product_category_enum_spec.rb
+++ b/BillingApi/spec/models/product_category_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ProductCategoryEnum do
- let(:instance) { BillingApi::ProductCategoryEnum.new }
+ #let(:instance) { BillingApi::ProductCategoryEnum.new }
describe 'test an instance of ProductCategoryEnum' do
it 'should create an instance of ProductCategoryEnum' do
diff --git a/BillingApi/spec/models/product_location_enum_spec.rb b/BillingApi/spec/models/product_location_enum_spec.rb
new file mode 100644
index 00000000..48f2c432
--- /dev/null
+++ b/BillingApi/spec/models/product_location_enum_spec.rb
@@ -0,0 +1,30 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::ProductLocationEnum
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::ProductLocationEnum do
+ #let(:instance) { BillingApi::ProductLocationEnum.new }
+
+ describe 'test an instance of ProductLocationEnum' do
+ it 'should create an instance of ProductLocationEnum' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::ProductLocationEnum)
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/product_spec.rb b/BillingApi/spec/models/product_spec.rb
index bdeb2e01..216fba74 100644
--- a/BillingApi/spec/models/product_spec.rb
+++ b/BillingApi/spec/models/product_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::Product do
- let(:instance) { BillingApi::Product.new }
+ #let(:instance) { BillingApi::Product.new }
describe 'test an instance of Product' do
it 'should create an instance of Product' do
diff --git a/BillingApi/spec/models/products_get200_response_inner_spec.rb b/BillingApi/spec/models/products_get200_response_inner_spec.rb
index 3f612079..43fb00b0 100644
--- a/BillingApi/spec/models/products_get200_response_inner_spec.rb
+++ b/BillingApi/spec/models/products_get200_response_inner_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/models/promo_credit_details_spec.rb b/BillingApi/spec/models/promo_credit_details_spec.rb
index 520db678..032518f9 100644
--- a/BillingApi/spec/models/promo_credit_details_spec.rb
+++ b/BillingApi/spec/models/promo_credit_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PromoCreditDetails do
- let(:instance) { BillingApi::PromoCreditDetails.new }
+ #let(:instance) { BillingApi::PromoCreditDetails.new }
describe 'test an instance of PromoCreditDetails' do
it 'should create an instance of PromoCreditDetails' do
diff --git a/BillingApi/spec/models/public_subnet_details_spec.rb b/BillingApi/spec/models/public_subnet_details_spec.rb
index 29180f54..68ceff32 100644
--- a/BillingApi/spec/models/public_subnet_details_spec.rb
+++ b/BillingApi/spec/models/public_subnet_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PublicSubnetDetails do
- let(:instance) { BillingApi::PublicSubnetDetails.new }
+ #let(:instance) { BillingApi::PublicSubnetDetails.new }
describe 'test an instance of PublicSubnetDetails' do
it 'should create an instance of PublicSubnetDetails' do
diff --git a/BillingApi/spec/models/public_subnet_record_spec.rb b/BillingApi/spec/models/public_subnet_record_spec.rb
index b2bb59b5..5f881982 100644
--- a/BillingApi/spec/models/public_subnet_record_spec.rb
+++ b/BillingApi/spec/models/public_subnet_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::PublicSubnetRecord do
- let(:instance) { BillingApi::PublicSubnetRecord.new }
+ #let(:instance) { BillingApi::PublicSubnetRecord.new }
describe 'test an instance of PublicSubnetRecord' do
it 'should create an instance of PublicSubnetRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/quantity_spec.rb b/BillingApi/spec/models/quantity_spec.rb
new file mode 100644
index 00000000..9969691a
--- /dev/null
+++ b/BillingApi/spec/models/quantity_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::Quantity
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::Quantity do
+ #let(:instance) { BillingApi::Quantity.new }
+
+ describe 'test an instance of Quantity' do
+ it 'should create an instance of Quantity' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::Quantity)
+ end
+ end
+
+ describe 'test attribute "quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "unit"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/quantity_unit_enum_spec.rb b/BillingApi/spec/models/quantity_unit_enum_spec.rb
new file mode 100644
index 00000000..bbca3081
--- /dev/null
+++ b/BillingApi/spec/models/quantity_unit_enum_spec.rb
@@ -0,0 +1,30 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::QuantityUnitEnum
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::QuantityUnitEnum do
+ #let(:instance) { BillingApi::QuantityUnitEnum.new }
+
+ describe 'test an instance of QuantityUnitEnum' do
+ it 'should create an instance of QuantityUnitEnum' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::QuantityUnitEnum)
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/rated_usage_get200_response_inner_spec.rb b/BillingApi/spec/models/rated_usage_get200_response_inner_spec.rb
index f898ae3d..fdc1c58c 100644
--- a/BillingApi/spec/models/rated_usage_get200_response_inner_spec.rb
+++ b/BillingApi/spec/models/rated_usage_get200_response_inner_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BillingApi/spec/models/rated_usage_product_category_enum_spec.rb b/BillingApi/spec/models/rated_usage_product_category_enum_spec.rb
index ab61c9a3..e2a48938 100644
--- a/BillingApi/spec/models/rated_usage_product_category_enum_spec.rb
+++ b/BillingApi/spec/models/rated_usage_product_category_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::RatedUsageProductCategoryEnum do
- let(:instance) { BillingApi::RatedUsageProductCategoryEnum.new }
+ #let(:instance) { BillingApi::RatedUsageProductCategoryEnum.new }
describe 'test an instance of RatedUsageProductCategoryEnum' do
it 'should create an instance of RatedUsageProductCategoryEnum' do
diff --git a/BillingApi/spec/models/rated_usage_record_spec.rb b/BillingApi/spec/models/rated_usage_record_spec.rb
index 755008de..94ab06ce 100644
--- a/BillingApi/spec/models/rated_usage_record_spec.rb
+++ b/BillingApi/spec/models/rated_usage_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::RatedUsageRecord do
- let(:instance) { BillingApi::RatedUsageRecord.new }
+ #let(:instance) { BillingApi::RatedUsageRecord.new }
describe 'test an instance of RatedUsageRecord' do
it 'should create an instance of RatedUsageRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/reservation_auto_renew_disable_request_spec.rb b/BillingApi/spec/models/reservation_auto_renew_disable_request_spec.rb
index 9c6fb1f5..87aa811a 100644
--- a/BillingApi/spec/models/reservation_auto_renew_disable_request_spec.rb
+++ b/BillingApi/spec/models/reservation_auto_renew_disable_request_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ReservationAutoRenewDisableRequest do
- let(:instance) { BillingApi::ReservationAutoRenewDisableRequest.new }
+ #let(:instance) { BillingApi::ReservationAutoRenewDisableRequest.new }
describe 'test an instance of ReservationAutoRenewDisableRequest' do
it 'should create an instance of ReservationAutoRenewDisableRequest' do
diff --git a/BillingApi/spec/models/reservation_details_spec.rb b/BillingApi/spec/models/reservation_details_spec.rb
new file mode 100644
index 00000000..59730948
--- /dev/null
+++ b/BillingApi/spec/models/reservation_details_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::ReservationDetails
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::ReservationDetails do
+ #let(:instance) { BillingApi::ReservationDetails.new }
+
+ describe 'test an instance of ReservationDetails' do
+ it 'should create an instance of ReservationDetails' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::ReservationDetails)
+ end
+ end
+
+ describe 'test attribute "id"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/reservation_invoicing_model_enum_spec.rb b/BillingApi/spec/models/reservation_invoicing_model_enum_spec.rb
index 40696ec2..5524747d 100644
--- a/BillingApi/spec/models/reservation_invoicing_model_enum_spec.rb
+++ b/BillingApi/spec/models/reservation_invoicing_model_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ReservationInvoicingModelEnum do
- let(:instance) { BillingApi::ReservationInvoicingModelEnum.new }
+ #let(:instance) { BillingApi::ReservationInvoicingModelEnum.new }
describe 'test an instance of ReservationInvoicingModelEnum' do
it 'should create an instance of ReservationInvoicingModelEnum' do
diff --git a/BillingApi/spec/models/reservation_model_enum_spec.rb b/BillingApi/spec/models/reservation_model_enum_spec.rb
index 04de44fc..c1240256 100644
--- a/BillingApi/spec/models/reservation_model_enum_spec.rb
+++ b/BillingApi/spec/models/reservation_model_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ReservationModelEnum do
- let(:instance) { BillingApi::ReservationModelEnum.new }
+ #let(:instance) { BillingApi::ReservationModelEnum.new }
describe 'test an instance of ReservationModelEnum' do
it 'should create an instance of ReservationModelEnum' do
diff --git a/BillingApi/spec/models/reservation_product_category_enum_spec.rb b/BillingApi/spec/models/reservation_product_category_enum_spec.rb
index c0b9fbe7..a81261ae 100644
--- a/BillingApi/spec/models/reservation_product_category_enum_spec.rb
+++ b/BillingApi/spec/models/reservation_product_category_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ReservationProductCategoryEnum do
- let(:instance) { BillingApi::ReservationProductCategoryEnum.new }
+ #let(:instance) { BillingApi::ReservationProductCategoryEnum.new }
describe 'test an instance of ReservationProductCategoryEnum' do
it 'should create an instance of ReservationProductCategoryEnum' do
diff --git a/BillingApi/spec/models/reservation_request_spec.rb b/BillingApi/spec/models/reservation_request_spec.rb
index 12716ab9..28548ab7 100644
--- a/BillingApi/spec/models/reservation_request_spec.rb
+++ b/BillingApi/spec/models/reservation_request_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ReservationRequest do
- let(:instance) { BillingApi::ReservationRequest.new }
+ #let(:instance) { BillingApi::ReservationRequest.new }
describe 'test an instance of ReservationRequest' do
it 'should create an instance of ReservationRequest' do
@@ -33,4 +33,10 @@
end
end
+ describe 'test attribute "quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
end
diff --git a/BillingApi/spec/models/reservation_spec.rb b/BillingApi/spec/models/reservation_spec.rb
index 36366417..0eeaf2b9 100644
--- a/BillingApi/spec/models/reservation_spec.rb
+++ b/BillingApi/spec/models/reservation_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::Reservation do
- let(:instance) { BillingApi::Reservation.new }
+ #let(:instance) { BillingApi::Reservation.new }
describe 'test an instance of Reservation' do
it 'should create an instance of Reservation' do
@@ -57,12 +57,30 @@
end
end
+ describe 'test attribute "term"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "reservation_state"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "initial_invoice_model"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end
+ describe 'test attribute "quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "start_date_time"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -123,4 +141,10 @@
end
end
+ describe 'test attribute "utilization"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
end
diff --git a/BillingApi/spec/models/reservation_state_enum_spec.rb b/BillingApi/spec/models/reservation_state_enum_spec.rb
new file mode 100644
index 00000000..04dc0a22
--- /dev/null
+++ b/BillingApi/spec/models/reservation_state_enum_spec.rb
@@ -0,0 +1,30 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::ReservationStateEnum
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::ReservationStateEnum do
+ #let(:instance) { BillingApi::ReservationStateEnum.new }
+
+ describe 'test an instance of ReservationStateEnum' do
+ it 'should create an instance of ReservationStateEnum' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::ReservationStateEnum)
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/reservation_term_spec.rb b/BillingApi/spec/models/reservation_term_spec.rb
new file mode 100644
index 00000000..8573a659
--- /dev/null
+++ b/BillingApi/spec/models/reservation_term_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::ReservationTerm
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::ReservationTerm do
+ #let(:instance) { BillingApi::ReservationTerm.new }
+
+ describe 'test an instance of ReservationTerm' do
+ it 'should create an instance of ReservationTerm' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::ReservationTerm)
+ end
+ end
+
+ describe 'test attribute "length_in_months"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "reservation_model"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/models/server_details_spec.rb b/BillingApi/spec/models/server_details_spec.rb
index d642cc2d..9652d016 100644
--- a/BillingApi/spec/models/server_details_spec.rb
+++ b/BillingApi/spec/models/server_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ServerDetails do
- let(:instance) { BillingApi::ServerDetails.new }
+ #let(:instance) { BillingApi::ServerDetails.new }
describe 'test an instance of ServerDetails' do
it 'should create an instance of ServerDetails' do
diff --git a/BillingApi/spec/models/server_product_metadata_spec.rb b/BillingApi/spec/models/server_product_metadata_spec.rb
index fe2cea67..b2f82833 100644
--- a/BillingApi/spec/models/server_product_metadata_spec.rb
+++ b/BillingApi/spec/models/server_product_metadata_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ServerProductMetadata do
- let(:instance) { BillingApi::ServerProductMetadata.new }
+ #let(:instance) { BillingApi::ServerProductMetadata.new }
describe 'test an instance of ServerProductMetadata' do
it 'should create an instance of ServerProductMetadata' do
diff --git a/BillingApi/spec/models/server_product_spec.rb b/BillingApi/spec/models/server_product_spec.rb
index 97523cb0..c3f6b0cb 100644
--- a/BillingApi/spec/models/server_product_spec.rb
+++ b/BillingApi/spec/models/server_product_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ServerProduct do
- let(:instance) { BillingApi::ServerProduct.new }
+ #let(:instance) { BillingApi::ServerProduct.new }
describe 'test an instance of ServerProduct' do
it 'should create an instance of ServerProduct' do
diff --git a/BillingApi/spec/models/server_record_spec.rb b/BillingApi/spec/models/server_record_spec.rb
index 17257029..5a878923 100644
--- a/BillingApi/spec/models/server_record_spec.rb
+++ b/BillingApi/spec/models/server_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ServerRecord do
- let(:instance) { BillingApi::ServerRecord.new }
+ #let(:instance) { BillingApi::ServerRecord.new }
describe 'test an instance of ServerRecord' do
it 'should create an instance of ServerRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/storage_details_spec.rb b/BillingApi/spec/models/storage_details_spec.rb
index 82e2e3c1..6f62be4b 100644
--- a/BillingApi/spec/models/storage_details_spec.rb
+++ b/BillingApi/spec/models/storage_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::StorageDetails do
- let(:instance) { BillingApi::StorageDetails.new }
+ #let(:instance) { BillingApi::StorageDetails.new }
describe 'test an instance of StorageDetails' do
it 'should create an instance of StorageDetails' do
diff --git a/BillingApi/spec/models/storage_record_spec.rb b/BillingApi/spec/models/storage_record_spec.rb
index 5a368c4f..c3665b05 100644
--- a/BillingApi/spec/models/storage_record_spec.rb
+++ b/BillingApi/spec/models/storage_record_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::StorageRecord do
- let(:instance) { BillingApi::StorageRecord.new }
+ #let(:instance) { BillingApi::StorageRecord.new }
describe 'test an instance of StorageRecord' do
it 'should create an instance of StorageRecord' do
@@ -135,6 +135,12 @@
end
end
+ describe 'test attribute "reservation_details"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
describe 'test attribute "discount_details"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
diff --git a/BillingApi/spec/models/system_credit_cause_enum_spec.rb b/BillingApi/spec/models/system_credit_cause_enum_spec.rb
index eb31765f..50cc8440 100644
--- a/BillingApi/spec/models/system_credit_cause_enum_spec.rb
+++ b/BillingApi/spec/models/system_credit_cause_enum_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::SystemCreditCauseEnum do
- let(:instance) { BillingApi::SystemCreditCauseEnum.new }
+ #let(:instance) { BillingApi::SystemCreditCauseEnum.new }
describe 'test an instance of SystemCreditCauseEnum' do
it 'should create an instance of SystemCreditCauseEnum' do
diff --git a/BillingApi/spec/models/system_credit_details_spec.rb b/BillingApi/spec/models/system_credit_details_spec.rb
index db8b5a8a..9070e4b3 100644
--- a/BillingApi/spec/models/system_credit_details_spec.rb
+++ b/BillingApi/spec/models/system_credit_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::SystemCreditDetails do
- let(:instance) { BillingApi::SystemCreditDetails.new }
+ #let(:instance) { BillingApi::SystemCreditDetails.new }
describe 'test an instance of SystemCreditDetails' do
it 'should create an instance of SystemCreditDetails' do
diff --git a/BillingApi/spec/models/threshold_configuration_details_spec.rb b/BillingApi/spec/models/threshold_configuration_details_spec.rb
index 1f99489b..01f0cd3c 100644
--- a/BillingApi/spec/models/threshold_configuration_details_spec.rb
+++ b/BillingApi/spec/models/threshold_configuration_details_spec.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -18,7 +18,7 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe BillingApi::ThresholdConfigurationDetails do
- let(:instance) { BillingApi::ThresholdConfigurationDetails.new }
+ #let(:instance) { BillingApi::ThresholdConfigurationDetails.new }
describe 'test an instance of ThresholdConfigurationDetails' do
it 'should create an instance of ThresholdConfigurationDetails' do
diff --git a/BillingApi/spec/models/utilization_spec.rb b/BillingApi/spec/models/utilization_spec.rb
new file mode 100644
index 00000000..cba11e6e
--- /dev/null
+++ b/BillingApi/spec/models/utilization_spec.rb
@@ -0,0 +1,42 @@
+=begin
+#Billing API
+
+#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/billing/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for BillingApi::Utilization
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+describe BillingApi::Utilization do
+ #let(:instance) { BillingApi::Utilization.new }
+
+ describe 'test an instance of Utilization' do
+ it 'should create an instance of Utilization' do
+ # uncomment below to test the instance creation
+ #expect(instance).to be_instance_of(BillingApi::Utilization)
+ end
+ end
+
+ describe 'test attribute "quantity"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+ describe 'test attribute "percentage"' do
+ it 'should work' do
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
+ end
+ end
+
+end
diff --git a/BillingApi/spec/spec_helper.rb b/BillingApi/spec/spec_helper.rb
index ddb6c36b..cea26e75 100644
--- a/BillingApi/spec/spec_helper.rb
+++ b/BillingApi/spec/spec_helper.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BmcApi/README.md b/BmcApi/README.md
index ac2885af..02620a90 100644
--- a/BmcApi/README.md
+++ b/BmcApi/README.md
@@ -141,6 +141,7 @@ Class | Method | HTTP request | Description
*BmcApi::ServersApi* | [**servers_server_id_actions_reserve_post**](docs/ServersApi.md#servers_server_id_actions_reserve_post) | **POST** /servers/{serverId}/actions/reserve | Reserve server.
*BmcApi::ServersApi* | [**servers_server_id_actions_reset_post**](docs/ServersApi.md#servers_server_id_actions_reset_post) | **POST** /servers/{serverId}/actions/reset | Reset server.
*BmcApi::ServersApi* | [**servers_server_id_actions_shutdown_post**](docs/ServersApi.md#servers_server_id_actions_shutdown_post) | **POST** /servers/{serverId}/actions/shutdown | Shutdown server.
+*BmcApi::ServersApi* | [**servers_server_id_actions_transfer_reservation**](docs/ServersApi.md#servers_server_id_actions_transfer_reservation) | **POST** /servers/{serverId}/actions/transfer-reservation | Transfer server reservation.
*BmcApi::ServersApi* | [**servers_server_id_delete**](docs/ServersApi.md#servers_server_id_delete) | **DELETE** /servers/{serverId} | Delete server.
*BmcApi::ServersApi* | [**servers_server_id_get**](docs/ServersApi.md#servers_server_id_get) | **GET** /servers/{serverId} | Get server.
*BmcApi::ServersApi* | [**servers_server_id_ip_blocks_ip_block_id_delete**](docs/ServersApi.md#servers_server_id_ip_blocks_ip_block_id_delete) | **DELETE** /servers/{serverId}/network-configuration/ip-block-configurations/ip-blocks/{ipBlockId} | Unassign IP Block from Server.
@@ -179,6 +180,7 @@ Class | Method | HTTP request | Description
- [BmcApi::QuotaEditLimitRequest](docs/QuotaEditLimitRequest.md)
- [BmcApi::QuotaEditLimitRequestDetails](docs/QuotaEditLimitRequestDetails.md)
- [BmcApi::RelinquishIpBlock](docs/RelinquishIpBlock.md)
+ - [BmcApi::ReservationTransferDetails](docs/ReservationTransferDetails.md)
- [BmcApi::ResetResult](docs/ResetResult.md)
- [BmcApi::Server](docs/Server.md)
- [BmcApi::ServerCreate](docs/ServerCreate.md)
diff --git a/BmcApi/VERSION b/BmcApi/VERSION
index 7e541aec..276cbf9e 100644
--- a/BmcApi/VERSION
+++ b/BmcApi/VERSION
@@ -1 +1 @@
-2.2.2
\ No newline at end of file
+2.3.0
diff --git a/BmcApi/docs/IpBlocksConfiguration.md b/BmcApi/docs/IpBlocksConfiguration.md
index be724d4a..e8e18a37 100644
--- a/BmcApi/docs/IpBlocksConfiguration.md
+++ b/BmcApi/docs/IpBlocksConfiguration.md
@@ -5,7 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **configuration_type** | **String** | (Write-only) Determines the approach for configuring IP blocks for the server being provisioned. If PURCHASE_NEW is selected, the smallest supported range, depending on the operating system, is allocated to the server. | [optional][default to 'PURCHASE_NEW'] |
-| **ip_blocks** | [**Array<ServerIpBlock>**](ServerIpBlock.md) | Used to specify the previously purchased IP blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType. | [optional] |
+| **ip_blocks** | [**Array<ServerIpBlock>**](ServerIpBlock.md) | Used for specifying the previously purchased IPv4 blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType. | [optional] |
## Example
diff --git a/BmcApi/docs/OsConfigurationCloudInit.md b/BmcApi/docs/OsConfigurationCloudInit.md
index 5d438904..b873794f 100644
--- a/BmcApi/docs/OsConfigurationCloudInit.md
+++ b/BmcApi/docs/OsConfigurationCloudInit.md
@@ -12,7 +12,7 @@
require 'pnap_bmc_api'
instance = BmcApi::OsConfigurationCloudInit.new(
- user_data: [B@5ae15
+ user_data: [B@7243145f
)
```
diff --git a/BmcApi/docs/OsConfigurationWindows.md b/BmcApi/docs/OsConfigurationWindows.md
index 7e8963dc..d67d00ba 100644
--- a/BmcApi/docs/OsConfigurationWindows.md
+++ b/BmcApi/docs/OsConfigurationWindows.md
@@ -5,6 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **rdp_allowed_ips** | **Array<String>** | List of IPs allowed for RDP access to Windows OS. Supported in single IP, CIDR and range format. When undefined, RDP is disabled. To allow RDP access from any IP use 0.0.0.0/0. This will only be returned in response to provisioning a server. | [optional] |
+| **bring_your_own_license** | **Boolean** | Use a Bring Your Own (BYO) Windows license. If true, the server is provisioned in trial mode, and you must activate your own license. If false (default), the server includes a managed Windows license billed by the platform. | [optional][default to false] |
## Example
@@ -12,7 +13,8 @@
require 'pnap_bmc_api'
instance = BmcApi::OsConfigurationWindows.new(
- rdp_allowed_ips: ["172.217.22.14","10.111.14.40/29","10.111.14.66 - 10.111.14.71"]
+ rdp_allowed_ips: ["172.217.22.14","10.111.14.40/29","10.111.14.66 - 10.111.14.71"],
+ bring_your_own_license: false
)
```
diff --git a/BmcApi/docs/PrivateNetworkConfiguration.md b/BmcApi/docs/PrivateNetworkConfiguration.md
index ba799d00..064bcb93 100644
--- a/BmcApi/docs/PrivateNetworkConfiguration.md
+++ b/BmcApi/docs/PrivateNetworkConfiguration.md
@@ -6,7 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **gateway_address** | **String** | Deprecated in favour of a common gateway address across all networks available under NetworkConfiguration.<br> The address of the gateway assigned / to assign to the server.<br> When used as part of request body, IP address has to be part of private network assigned to this server.<br> Gateway address also has to be assigned on an already deployed resource unless the `force` query parameter is true. | [optional] |
| **configuration_type** | **String** | (Write-only) Determines the approach for configuring private network(s) for the server being provisioned. Currently this field should be set to `USE_OR_CREATE_DEFAULT`, `USER_DEFINED` or `NONE`. | [optional][default to 'USE_OR_CREATE_DEFAULT'] |
-| **private_networks** | [**Array<ServerPrivateNetwork>**](ServerPrivateNetwork.md) | The list of private networks this server is member of. When this field is part of request body, it'll be used to specify the private networks to assign to this server upon provisioning. Used alongside the `USER_DEFINED` configurationType. | [optional] |
+| **private_networks** | [**Array<ServerPrivateNetwork>**](ServerPrivateNetwork.md) | The list of private networks this server belongs to. If this field is part of a request body, it will be used for specifying the private networks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType. | [optional] |
## Example
diff --git a/BmcApi/docs/PublicNetworkConfiguration.md b/BmcApi/docs/PublicNetworkConfiguration.md
index f0a5a518..a277f3bc 100644
--- a/BmcApi/docs/PublicNetworkConfiguration.md
+++ b/BmcApi/docs/PublicNetworkConfiguration.md
@@ -4,7 +4,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
-| **public_networks** | [**Array<ServerPublicNetwork>**](ServerPublicNetwork.md) | The list of public networks this server is member of. When this field is part of request body, it'll be used to specify the public networks to assign to this server upon provisioning. | [optional] |
+| **public_networks** | [**Array<ServerPublicNetwork>**](ServerPublicNetwork.md) | The list of public networks this server belongs to. If this field is part of a request body, it will be used for specifying the public networks to assign to this server on provision. Only IPv4 addresses can be specified. | [optional] |
## Example
diff --git a/BmcApi/docs/ReservationTransferDetails.md b/BmcApi/docs/ReservationTransferDetails.md
new file mode 100644
index 00000000..d9129094
--- /dev/null
+++ b/BmcApi/docs/ReservationTransferDetails.md
@@ -0,0 +1,18 @@
+# BmcApi::ReservationTransferDetails
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **target_server_id** | **String** | ID of target server to transfer reservation to. | |
+
+## Example
+
+```ruby
+require 'pnap_bmc_api'
+
+instance = BmcApi::ReservationTransferDetails.new(
+ target_server_id: 54a21648dasda4s9843a17
+)
+```
+
diff --git a/BmcApi/docs/Server.md b/BmcApi/docs/Server.md
index 1c8fa6ba..4c1347cc 100644
--- a/BmcApi/docs/Server.md
+++ b/BmcApi/docs/Server.md
@@ -8,9 +8,9 @@
| **status** | **String** | The status of the server. Can have one of the following values: `creating` , `powered-on` , `powered-off` , `rebooting` , `resetting` , `deleting` , `reserved` , `error` or `reinstating`. | |
| **hostname** | **String** | Hostname of server. | |
| **description** | **String** | Description of server. | [optional] |
-| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | [optional] |
-| **type** | **String** | Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, s4.x6.c6.large or s4.x6.m6.xlarge. | |
-| **location** | **String** | Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`. | |
+| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | [optional] |
+| **type** | **String** | Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c4.small`, `d1.c4.medium`, `d1.c4.large`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, `d3.g3.c2.medium`, `s4.x6.c6.large`, `s4.x6.m6.xlarge`, `s5.x6.c3.medium`, `s5.x6.c3.large`, `s5.x6.c8.medium`, `s5.x6.c9.medium`, `s5.x6.c8.large`, `s5.x6.c9.large`, `s5.x6.m8.xlarge`, `s5.x6.m9.xlarge`, `s4.c3.medium`, `s4.c6.medium`, `s4.c6.large`, `s4.c6.xlarge`, `s4.s2.large`, `a2.c9.large` or `a2.c9.xlarge`. | |
+| **location** | **String** | Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`. | |
| **cpu** | **String** | A description of the machine CPU. | |
| **cpu_count** | **Integer** | The number of CPUs available in the system. | |
| **cores_per_cpu** | **Integer** | The number of physical cores present on each CPU. | |
diff --git a/BmcApi/docs/ServerCreate.md b/BmcApi/docs/ServerCreate.md
index 8581cb27..9d168cb0 100644
--- a/BmcApi/docs/ServerCreate.md
+++ b/BmcApi/docs/ServerCreate.md
@@ -6,9 +6,9 @@
| ---- | ---- | ----------- | ----- |
| **hostname** | **String** | Hostname of server. | |
| **description** | **String** | Description of server. | [optional] |
-| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | |
-| **type** | **String** | Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, s4.x6.c6.large or s4.x6.m6.xlarge. | |
-| **location** | **String** | Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`. | |
+| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | |
+| **type** | **String** | Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c4.small`, `d1.c4.medium`, `d1.c4.large`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`,`d3.g3.c2.medium`, `s4.x6.c6.large`, `s4.x6.m6.xlarge`, `s5.x6.c3.medium`, `s5.x6.c3.large`, `s5.x6.c8.medium`, `s5.x6.c9.medium`, `s5.x6.c8.large`, `s5.x6.c9.large`, `s5.x6.m8.xlarge`, `s5.x6.m9.xlarge`, `s4.c3.medium`, `s4.c6.medium`, `s4.c6.large`, `s4.c6.xlarge`, `s4.s2.large`, `a2.c9.large` or `a2.c9.xlarge`. | |
+| **location** | **String** | Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`. | |
| **install_default_ssh_keys** | **Boolean** | Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request. | [optional][default to true] |
| **ssh_keys** | **Array<String>** | A list of SSH keys that will be installed on the server. | [optional] |
| **ssh_key_ids** | **Array<String>** | A list of SSH key IDs that will be installed on the server in addition to any SSH keys specified in this request. | [optional] |
diff --git a/BmcApi/docs/ServerNetworkUpdate.md b/BmcApi/docs/ServerNetworkUpdate.md
index 71d54c3e..4b322da3 100644
--- a/BmcApi/docs/ServerNetworkUpdate.md
+++ b/BmcApi/docs/ServerNetworkUpdate.md
@@ -4,7 +4,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
-| **ips** | **Array<String>** | List of IPs to be associated to the server.<br> Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). IPs must be within the network's range.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul> | [optional] |
+| **ips** | **Array<String>** | List of IPs to be associated to the server.<br> Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All IPs must be within the network's range.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul> | [optional] |
## Example
diff --git a/BmcApi/docs/ServerPrivateNetwork.md b/BmcApi/docs/ServerPrivateNetwork.md
index c11a2b34..80ddce5a 100644
--- a/BmcApi/docs/ServerPrivateNetwork.md
+++ b/BmcApi/docs/ServerPrivateNetwork.md
@@ -8,6 +8,7 @@
| **ips** | **Array<String>** | IPs to configure/configured on the server.<br> Valid IP formats are single IPv4 addresses or IPv4 ranges. IPs must be within the network's range. Should be null or empty list if DHCP is true. <br> If field is undefined and DHCP is false, next available IP in network will be automatically allocated.<br> If the network contains a membership of type 'storage', the first twelve IPs are already reserved by BMC and not usable.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul> | [optional] |
| **dhcp** | **Boolean** | Determines whether DHCP is enabled for this server.<br> The following restrictions apply when enabling DHCP:<ul> <li> DHCP support is limited to servers configured exclusively with private networks (PRIVATE_ONLY). <li> DHCP value needs to be consistent across all server-configured private networks. <li> The server does not support manual gateway address configuration. <li> Private IP addresses for network cannot be specified.</ul> Note: Not supported on Proxmox OS. | [optional][default to false] |
| **status_description** | **String** | (Read-only) The status of the network. | [optional][readonly] |
+| **vlan_id** | **Integer** | (Read-only) The VLAN on which this network has been configured within the network switch. | [optional][readonly] |
## Example
@@ -18,7 +19,8 @@ instance = BmcApi::ServerPrivateNetwork.new(
id: 603f3b2cfcaf050643b89a4b,
ips: ["10.1.1.1","10.1.1.20 - 10.1.1.25"],
dhcp: false,
- status_description: assigned
+ status_description: assigned,
+ vlan_id: 10
)
```
diff --git a/BmcApi/docs/ServerProvision.md b/BmcApi/docs/ServerProvision.md
index 8942e805..f7970efb 100644
--- a/BmcApi/docs/ServerProvision.md
+++ b/BmcApi/docs/ServerProvision.md
@@ -6,7 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **hostname** | **String** | Hostname of server. | |
| **description** | **String** | Description of server. | [optional] |
-| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | |
+| **os** | **String** | The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`,`netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`. | |
| **install_default_ssh_keys** | **Boolean** | Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request. | [optional][default to true] |
| **ssh_keys** | **Array<String>** | A list of SSH keys that will be installed on the server. | [optional] |
| **ssh_key_ids** | **Array<String>** | A list of SSH key IDs that will be installed on the server in addition to any SSH keys specified in this request. | [optional] |
diff --git a/BmcApi/docs/ServerPublicNetwork.md b/BmcApi/docs/ServerPublicNetwork.md
index fc9ad93a..89a40399 100644
--- a/BmcApi/docs/ServerPublicNetwork.md
+++ b/BmcApi/docs/ServerPublicNetwork.md
@@ -5,9 +5,10 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | The network identifier. | |
-| **ips** | **Array<String>** | Configurable/configured IPs on the server.<br> At least 1 IP address is required. Valid IP format is single IP addresses. All IPs must be within the network's range.<br> Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.<br> Additionally, setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul> | [optional] |
+| **ips** | **Array<String>** | Configurable/configured IPs on the server.<br> At least 1 IP address is required. Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All IPs must be within the network's range.<br> Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.<br> Additionally, setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul> | [optional] |
| **status_description** | **String** | (Read-only) The status of the assignment to the network. | [optional][readonly] |
| **compute_slaac_ip** | **Boolean** | (Write-only) Requests Stateless Address Autoconfiguration (SLAAC). Applicable for Network which contains IPv6 block(s). | [optional] |
+| **vlan_id** | **Integer** | (Read-only) The VLAN on which this network has been configured within the network switch. | [optional][readonly] |
## Example
@@ -16,9 +17,10 @@ require 'pnap_bmc_api'
instance = BmcApi::ServerPublicNetwork.new(
id: 60473c2509268bc77fd06d29,
- ips: ["182.16.0.146","2001:db8::b"],
+ ips: ["182.16.0.146","10.1.1.20 - 10.1.1.25","2001:db8::f","2001:db8::b - 2001:db8::d"],
status_description: assigned,
- compute_slaac_ip: true
+ compute_slaac_ip: true,
+ vlan_id: 10
)
```
diff --git a/BmcApi/docs/ServersApi.md b/BmcApi/docs/ServersApi.md
index 11673080..ad55a923 100644
--- a/BmcApi/docs/ServersApi.md
+++ b/BmcApi/docs/ServersApi.md
@@ -15,6 +15,7 @@ All URIs are relative to *https://api.phoenixnap.com/bmc/v1*
| [**servers_server_id_actions_reserve_post**](ServersApi.md#servers_server_id_actions_reserve_post) | **POST** /servers/{serverId}/actions/reserve | Reserve server. |
| [**servers_server_id_actions_reset_post**](ServersApi.md#servers_server_id_actions_reset_post) | **POST** /servers/{serverId}/actions/reset | Reset server. |
| [**servers_server_id_actions_shutdown_post**](ServersApi.md#servers_server_id_actions_shutdown_post) | **POST** /servers/{serverId}/actions/shutdown | Shutdown server. |
+| [**servers_server_id_actions_transfer_reservation**](ServersApi.md#servers_server_id_actions_transfer_reservation) | **POST** /servers/{serverId}/actions/transfer-reservation | Transfer server reservation. |
| [**servers_server_id_delete**](ServersApi.md#servers_server_id_delete) | **DELETE** /servers/{serverId} | Delete server. |
| [**servers_server_id_get**](ServersApi.md#servers_server_id_get) | **GET** /servers/{serverId} | Get server. |
| [**servers_server_id_ip_blocks_ip_block_id_delete**](ServersApi.md#servers_server_id_ip_blocks_ip_block_id_delete) | **DELETE** /servers/{serverId}/network-configuration/ip-block-configurations/ip-blocks/{ipBlockId} | Unassign IP Block from Server. |
@@ -807,6 +808,77 @@ end
- **Accept**: application/json
+## servers_server_id_actions_transfer_reservation
+
+> servers_server_id_actions_transfer_reservation(server_id, reservation_transfer_details)
+
+Transfer server reservation.
+
+Transfer server reservation. An active (READY) reservation can be transferred from a server in ERROR or RESERVED status to another HOURLY provisioned server of the same location and type.
+
+### Examples
+
+```ruby
+require 'time'
+require 'pnap_bmc_api'
+# setup authorization
+BmcApi.configure do |config|
+ # Configure OAuth2 access token for authorization: OAuth2
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = BmcApi::ServersApi.new
+server_id = '60473a6115e34466c9f8f083' # String | The server's ID.
+reservation_transfer_details = BmcApi::ReservationTransferDetails.new({target_server_id: '54a21648dasda4s9843a17'}) # ReservationTransferDetails |
+
+begin
+ # Transfer server reservation.
+ result = api_instance.servers_server_id_actions_transfer_reservation(server_id, reservation_transfer_details)
+ p result
+rescue BmcApi::ApiError => e
+ puts "Error when calling ServersApi->servers_server_id_actions_transfer_reservation: #{e}"
+end
+```
+
+#### Using the servers_server_id_actions_transfer_reservation_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details)
+
+```ruby
+begin
+ # Transfer server reservation.
+ data, status_code, headers = api_instance.servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue BmcApi::ApiError => e
+ puts "Error when calling ServersApi->servers_server_id_actions_transfer_reservation_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **server_id** | **String** | The server's ID. | |
+| **reservation_transfer_details** | [**ReservationTransferDetails**](ReservationTransferDetails.md) | | |
+
+### Return type
+
+[**Server**](Server.md)
+
+### Authorization
+
+[OAuth2](../README.md#OAuth2)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
## servers_server_id_delete
> servers_server_id_delete(server_id)
diff --git a/BmcApi/lib/pnap_bmc_api.rb b/BmcApi/lib/pnap_bmc_api.rb
index 7826f1a4..c6a2be47 100644
--- a/BmcApi/lib/pnap_bmc_api.rb
+++ b/BmcApi/lib/pnap_bmc_api.rb
@@ -6,13 +6,14 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
# Common files
require 'pnap_bmc_api/api_client'
require 'pnap_bmc_api/api_error'
+require 'pnap_bmc_api/api_model_base'
require 'pnap_bmc_api/version'
require 'pnap_bmc_api/configuration'
@@ -40,6 +41,7 @@
require 'pnap_bmc_api/models/quota_edit_limit_request'
require 'pnap_bmc_api/models/quota_edit_limit_request_details'
require 'pnap_bmc_api/models/relinquish_ip_block'
+require 'pnap_bmc_api/models/reservation_transfer_details'
require 'pnap_bmc_api/models/reset_result'
require 'pnap_bmc_api/models/server'
require 'pnap_bmc_api/models/server_create'
diff --git a/BmcApi/lib/pnap_bmc_api/api/quotas_api.rb b/BmcApi/lib/pnap_bmc_api/api/quotas_api.rb
index da26d677..048fb7ff 100644
--- a/BmcApi/lib/pnap_bmc_api/api/quotas_api.rb
+++ b/BmcApi/lib/pnap_bmc_api/api/quotas_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -45,7 +45,7 @@ def quotas_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -114,7 +114,7 @@ def quotas_quota_id_actions_request_edit_post_with_http_info(quota_id, quota_edi
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -182,7 +182,7 @@ def quotas_quota_id_get_with_http_info(quota_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
diff --git a/BmcApi/lib/pnap_bmc_api/api/servers_api.rb b/BmcApi/lib/pnap_bmc_api/api/servers_api.rb
index 7c81b669..82bfe5f1 100644
--- a/BmcApi/lib/pnap_bmc_api/api/servers_api.rb
+++ b/BmcApi/lib/pnap_bmc_api/api/servers_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -57,7 +57,7 @@ def delete_private_network_with_http_info(server_id, private_network_id, opts =
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -117,7 +117,7 @@ def servers_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -183,7 +183,7 @@ def servers_post_with_http_info(server_create, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -257,7 +257,7 @@ def servers_server_id_actions_deprovision_post_with_http_info(server_id, relinqu
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -325,7 +325,7 @@ def servers_server_id_actions_power_off_post_with_http_info(server_id, opts = {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -388,7 +388,7 @@ def servers_server_id_actions_power_on_post_with_http_info(server_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -460,7 +460,7 @@ def servers_server_id_actions_provision_post_with_http_info(server_id, server_pr
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -528,7 +528,7 @@ def servers_server_id_actions_reboot_post_with_http_info(server_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -597,7 +597,7 @@ def servers_server_id_actions_reserve_post_with_http_info(server_id, server_rese
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -671,7 +671,7 @@ def servers_server_id_actions_reset_post_with_http_info(server_id, server_reset,
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -739,7 +739,7 @@ def servers_server_id_actions_shutdown_post_with_http_info(server_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -770,6 +770,80 @@ def servers_server_id_actions_shutdown_post_with_http_info(server_id, opts = {})
return data, status_code, headers
end
+ # Transfer server reservation.
+ # Transfer server reservation. An active (READY) reservation can be transferred from a server in ERROR or RESERVED status to another HOURLY provisioned server of the same location and type.
+ # @param server_id [String] The server's ID.
+ # @param reservation_transfer_details [ReservationTransferDetails]
+ # @param [Hash] opts the optional parameters
+ # @return [Server]
+ def servers_server_id_actions_transfer_reservation(server_id, reservation_transfer_details, opts = {})
+ data, _status_code, _headers = servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details, opts)
+ data
+ end
+
+ # Transfer server reservation.
+ # Transfer server reservation. An active (READY) reservation can be transferred from a server in ERROR or RESERVED status to another HOURLY provisioned server of the same location and type.
+ # @param server_id [String] The server's ID.
+ # @param reservation_transfer_details [ReservationTransferDetails]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
+ def servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_transfer_reservation ...'
+ end
+ # verify the required parameter 'server_id' is set
+ if @api_client.config.client_side_validation && server_id.nil?
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_transfer_reservation"
+ end
+ # verify the required parameter 'reservation_transfer_details' is set
+ if @api_client.config.client_side_validation && reservation_transfer_details.nil?
+ fail ArgumentError, "Missing the required parameter 'reservation_transfer_details' when calling ServersApi.servers_server_id_actions_transfer_reservation"
+ end
+ # resource path
+ local_var_path = '/servers/{serverId}/actions/transfer-reservation'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(reservation_transfer_details)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Server'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
+
+ new_options = opts.merge(
+ :operation => :"ServersApi.servers_server_id_actions_transfer_reservation",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_transfer_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
# Delete server.
# Deprovision specific server. Any IP blocks assigned to this server will also be relinquished and deleted. Deprecated: see /servers/{serverId}/actions/deprovision
# @param server_id [String] The server's ID.
@@ -802,7 +876,7 @@ def servers_server_id_delete_with_http_info(server_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -865,7 +939,7 @@ def servers_server_id_get_with_http_info(server_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -940,7 +1014,7 @@ def servers_server_id_ip_blocks_ip_block_id_delete_with_http_info(server_id, ip_
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1014,7 +1088,7 @@ def servers_server_id_ip_blocks_post_with_http_info(server_id, server_ip_block,
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1088,7 +1162,7 @@ def servers_server_id_patch_with_http_info(server_id, server_patch, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1171,7 +1245,7 @@ def servers_server_id_private_networks_patch_with_http_info(server_id, private_n
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1248,7 +1322,7 @@ def servers_server_id_private_networks_post_with_http_info(server_id, server_pri
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1322,7 +1396,7 @@ def servers_server_id_public_networks_delete_with_http_info(server_id, public_ne
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -1400,7 +1474,7 @@ def servers_server_id_public_networks_patch_with_http_info(server_id, public_net
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1477,7 +1551,7 @@ def servers_server_id_public_networks_post_with_http_info(server_id, server_publ
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -1551,7 +1625,7 @@ def servers_server_id_tags_put_with_http_info(server_id, tag_assignment_request,
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
diff --git a/BmcApi/lib/pnap_bmc_api/api/ssh_keys_api.rb b/BmcApi/lib/pnap_bmc_api/api/ssh_keys_api.rb
index 6644cff4..633e2ee5 100644
--- a/BmcApi/lib/pnap_bmc_api/api/ssh_keys_api.rb
+++ b/BmcApi/lib/pnap_bmc_api/api/ssh_keys_api.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -45,7 +45,7 @@ def ssh_keys_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -108,7 +108,7 @@ def ssh_keys_post_with_http_info(ssh_key_create, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
@@ -176,7 +176,7 @@ def ssh_keys_ssh_key_id_delete_with_http_info(ssh_key_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -239,7 +239,7 @@ def ssh_keys_ssh_key_id_get_with_http_info(ssh_key_id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
@@ -308,7 +308,7 @@ def ssh_keys_ssh_key_id_put_with_http_info(ssh_key_id, ssh_key_update, opts = {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
diff --git a/BmcApi/lib/pnap_bmc_api/api_client.rb b/BmcApi/lib/pnap_bmc_api/api_client.rb
index 29e89728..e9fd15d6 100644
--- a/BmcApi/lib/pnap_bmc_api/api_client.rb
+++ b/BmcApi/lib/pnap_bmc_api/api_client.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -52,7 +52,8 @@ def self.default
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
def call_api(http_method, path, opts = {})
request = build_request(http_method, path, opts)
- tempfile = download_file(request) if opts[:return_type] == 'File'
+ tempfile = nil
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
response = request.run
if @config.debugging
@@ -191,19 +192,17 @@ def download_file(request)
chunk.force_encoding(encoding)
tempfile.write(chunk)
end
- # run the request to ensure the tempfile is created successfully before returning it
- request.run
- if tempfile
+ request.on_complete do
+ if !tempfile
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ end
tempfile.close
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
- else
- fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
+ yield tempfile if block_given?
end
-
- tempfile
end
# Check if the given MIME is a JSON MIME.
@@ -215,7 +214,7 @@ def download_file(request)
# @param [String] mime MIME
# @return [Boolean] True if the MIME is application/json
def json_mime?(mime)
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
end
# Deserialize the response to the given return type.
@@ -282,9 +281,13 @@ def convert_to_type(data, return_type)
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
end
else
- # models (e.g. Pet) or oneOf
+ # models (e.g. Pet) or oneOf/anyOf
klass = BmcApi.const_get(return_type)
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
+ klass.build(data)
+ else
+ klass.build_from_hash(data)
+ end
end
end
@@ -294,7 +297,7 @@ def convert_to_type(data, return_type)
# @param [String] filename the filename to be sanitized
# @return [String] the sanitized filename
def sanitize_filename(filename)
- filename.gsub(/.*[\/\\]/, '')
+ filename.split(/[\/\\]/).last
end
def build_request_url(path, opts = {})
@@ -394,4 +397,4 @@ def build_collection_param(param, collection_format)
end
end
end
-end
+end
\ No newline at end of file
diff --git a/BmcApi/lib/pnap_bmc_api/api_error.rb b/BmcApi/lib/pnap_bmc_api/api_error.rb
index 36acddd3..38d62649 100644
--- a/BmcApi/lib/pnap_bmc_api/api_error.rb
+++ b/BmcApi/lib/pnap_bmc_api/api_error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
diff --git a/BmcApi/lib/pnap_bmc_api/api_model_base.rb b/BmcApi/lib/pnap_bmc_api/api_model_base.rb
new file mode 100644
index 00000000..b5c818d2
--- /dev/null
+++ b/BmcApi/lib/pnap_bmc_api/api_model_base.rb
@@ -0,0 +1,88 @@
+=begin
+#Bare Metal Cloud API
+
+#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API. Deprovision servers, get or edit SSH key details, assign public IPs, assign servers to networks and a lot more. Manage your infrastructure more efficiently using just a few simple API calls.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/bmc/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+module BmcApi
+ class ApiModelBase
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = BmcApi.const_get(type)
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/BmcApi/lib/pnap_bmc_api/configuration.rb b/BmcApi/lib/pnap_bmc_api/configuration.rb
index 51003ac2..88ead4b0 100644
--- a/BmcApi/lib/pnap_bmc_api/configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -79,6 +79,14 @@ class Configuration
# @return [true, false]
attr_accessor :debugging
+ # Set this to ignore operation servers for the API client. This is useful when you need to
+ # send requests to a different server than the one specified in the OpenAPI document.
+ # Will default to the base url defined in the spec but can be overridden by setting
+ # `scheme`, `host`, `base_path` directly.
+ # Default to false.
+ # @return [true, false]
+ attr_accessor :ignore_operation_servers
+
# Defines the logger used for debugging.
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
#
@@ -166,6 +174,7 @@ def initialize
@timeout = 0
@params_encoding = nil
@debugging = false
+ @ignore_operation_servers = false
@inject_format = false
@force_ending_format = false
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -200,6 +209,7 @@ def base_path=(base_path)
# Returns base URL for specified operation based on server settings
def base_url(operation = nil)
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
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])
diff --git a/BmcApi/lib/pnap_bmc_api/models/action_result.rb b/BmcApi/lib/pnap_bmc_api/models/action_result.rb
index fa198b73..7866b139 100644
--- a/BmcApi/lib/pnap_bmc_api/models/action_result.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/action_result.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Result of a successful action.
- class ActionResult
+ class ActionResult < ApiModelBase
# Message describing the action's result.
attr_accessor :result
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ActionResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ActionResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -86,6 +92,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] result Value to be assigned
+ def result=(result)
+ if result.nil?
+ fail ArgumentError, 'result cannot be nil'
+ end
+
+ @result = result
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -129,61 +145,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -200,24 +161,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/delete_result.rb b/BmcApi/lib/pnap_bmc_api/models/delete_result.rb
index 16de1f38..69a7335c 100644
--- a/BmcApi/lib/pnap_bmc_api/models/delete_result.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/delete_result.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Result of a successful delete action.
- class DeleteResult
+ class DeleteResult < ApiModelBase
# Server has been deleted.
attr_accessor :result
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -102,6 +108,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] result Value to be assigned
+ def result=(result)
+ if result.nil?
+ fail ArgumentError, 'result cannot be nil'
+ end
+
+ @result = result
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] server_id Value to be assigned
+ def server_id=(server_id)
+ if server_id.nil?
+ fail ArgumentError, 'server_id cannot be nil'
+ end
+
+ @server_id = server_id
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -146,61 +172,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -217,24 +188,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/delete_ssh_key_result.rb b/BmcApi/lib/pnap_bmc_api/models/delete_ssh_key_result.rb
index dfc369d6..9acf11af 100644
--- a/BmcApi/lib/pnap_bmc_api/models/delete_ssh_key_result.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/delete_ssh_key_result.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Result of a successful delete action on a SSH key.
- class DeleteSshKeyResult
+ class DeleteSshKeyResult < ApiModelBase
# Resource has been deleted.
attr_accessor :result
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteSshKeyResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteSshKeyResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -102,6 +108,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] result Value to be assigned
+ def result=(result)
+ if result.nil?
+ fail ArgumentError, 'result cannot be nil'
+ end
+
+ @result = result
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] ssh_key_id Value to be assigned
+ def ssh_key_id=(ssh_key_id)
+ if ssh_key_id.nil?
+ fail ArgumentError, 'ssh_key_id cannot be nil'
+ end
+
+ @ssh_key_id = ssh_key_id
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -146,61 +172,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -217,24 +188,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/error.rb b/BmcApi/lib/pnap_bmc_api/models/error.rb
index edb7e68d..f2166fd4 100644
--- a/BmcApi/lib/pnap_bmc_api/models/error.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/error.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BmcApi
- class Error
+ class Error < ApiModelBase
# The description detailing the cause of the error code.
attr_accessor :message
@@ -29,9 +29,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -56,9 +61,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -96,6 +102,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] message Value to be assigned
+ def message=(message)
+ if message.nil?
+ fail ArgumentError, 'message cannot be nil'
+ end
+
+ @message = message
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -140,61 +156,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -211,24 +172,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb
index e232d33d..270af0b8 100644
--- a/BmcApi/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Esxi data storage configuration.
- class EsxiDatastoreConfiguration
+ class EsxiDatastoreConfiguration < ApiModelBase
# Datastore name
attr_accessor :datastore_name
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiDatastoreConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiDatastoreConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -80,7 +86,7 @@ def list_invalid_properties
end
if @datastore_name.to_s.length < 1
- invalid_properties.push('invalid value for "datastore_name", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "datastore_name", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^[a-zA-Z0-9]+$/)
@@ -114,7 +120,7 @@ def datastore_name=(datastore_name)
end
if datastore_name.to_s.length < 1
- fail ArgumentError, 'invalid value for "datastore_name", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "datastore_name", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^[a-zA-Z0-9]+$/)
@@ -168,61 +174,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -239,24 +190,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/esxi_os_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/esxi_os_configuration.rb
index 909485be..b97bddb7 100644
--- a/BmcApi/lib/pnap_bmc_api/models/esxi_os_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/esxi_os_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Esxi OS configuration.
- class EsxiOsConfiguration
+ class EsxiOsConfiguration < ApiModelBase
attr_accessor :datastore_configuration
# Attribute mapping from ruby-style variable name to JSON key.
@@ -25,9 +25,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -51,9 +56,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiOsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiOsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -121,61 +127,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -192,24 +143,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/gpu_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/gpu_configuration.rb
index c5a5d12b..37c2fb6d 100644
--- a/BmcApi/lib/pnap_bmc_api/models/gpu_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/gpu_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# The GPU configuration.
- class GpuConfiguration
+ class GpuConfiguration < ApiModelBase
# The long name of the GPU.
attr_accessor :long_name
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::GpuConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::GpuConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -132,61 +138,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -203,24 +154,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/ip_blocks_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/ip_blocks_configuration.rb
index 4ff85bf0..a98d5429 100644
--- a/BmcApi/lib/pnap_bmc_api/models/ip_blocks_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/ip_blocks_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,11 +15,11 @@
module BmcApi
# The IP blocks to assign to this server. This is an exclusive allocation, i.e. the IP blocks cannot be shared with other servers. If IpBlocksConfiguration is not defined, the purchase of a new IP block is determined by the networkType field.
- class IpBlocksConfiguration
+ class IpBlocksConfiguration < ApiModelBase
# (Write-only) Determines the approach for configuring IP blocks for the server being provisioned. If PURCHASE_NEW is selected, the smallest supported range, depending on the operating system, is allocated to the server.
attr_accessor :configuration_type
- # Used to specify the previously purchased IP blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
+ # Used for specifying the previously purchased IPv4 blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
attr_accessor :ip_blocks
class EnumAttributeValidator
@@ -52,9 +52,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -79,9 +84,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::IpBlocksConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::IpBlocksConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -189,61 +195,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -260,24 +211,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/network_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/network_configuration.rb
index 8bce783b..b8049d3f 100644
--- a/BmcApi/lib/pnap_bmc_api/models/network_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/network_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Entire network details of bare metal server.
- class NetworkConfiguration
+ class NetworkConfiguration < ApiModelBase
# The address of the gateway assigned / to assign to the server.
When used as part of request body, IP address has to be part of a private/public network or an IP block assigned to this server.
Gateway address also has to be assigned on an already deployed resource unless the address matches the BMC gateway address in a public network/IP block or the `force` query parameter is true.
attr_accessor :gateway_address
@@ -35,9 +35,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -64,9 +69,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::NetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::NetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -149,61 +155,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -220,24 +171,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration.rb
index c3365a51..ac60032a 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# OS specific configuration properties.
- class OsConfiguration
+ class OsConfiguration < ApiModelBase
attr_accessor :netris_controller
attr_accessor :netris_softgate
@@ -53,9 +53,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -87,9 +92,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -220,61 +226,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -291,24 +242,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb
index 3c25a246..d6ebcdc0 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Cloud-init configuration details.
- class OsConfigurationCloudInit
+ class OsConfigurationCloudInit < ApiModelBase
# (Write-only) User data for the cloud-init configuration in base64 encoding. NoCloud format is supported. Follow the instructions on how to provision a server using cloud-init. Only ubuntu/bionic, ubuntu/focal, ubuntu/jammy, debian/bullseye, debian/bookworm, centos/centos7, centos/centos8, almalinux/almalinux8, almalinux/almalinux9, rockylinux/rockylinux8, rockylinux/rockylinux9 and virtuozzo/virtuozzo7 are supported. User data will not be stored and cannot be retrieved once you deploy the server. Copy and save it for future reference.
attr_accessor :user_data
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationCloudInit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationCloudInit`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -122,61 +128,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -193,24 +144,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map.rb
index f96e16c0..9994eb86 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# OS specific configuration properties.
- class OsConfigurationMap
+ class OsConfigurationMap < ApiModelBase
attr_accessor :windows
attr_accessor :esxi
@@ -31,9 +31,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -59,9 +64,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMap`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMap`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -139,61 +145,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -210,24 +161,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb
index 50418195..48630c4b 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# VMWare ESXi configuration properties.
- class OsConfigurationMapEsxi
+ class OsConfigurationMapEsxi < ApiModelBase
# (Read-only) Password set for user root on an ESXi server which will only be returned in response to provisioning a server.
attr_accessor :root_password
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMapEsxi`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMapEsxi`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -163,61 +169,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -234,24 +185,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb
index b96f837f..1598cf2f 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Proxmox VE configuration properties.
- class OsConfigurationMapProxmox
+ class OsConfigurationMapProxmox < ApiModelBase
# (Read-only) Password set for user root on a Proxmox server which will only be returned in response to provisioning a server.
attr_accessor :root_password
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMapProxmox`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationMapProxmox`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -163,61 +169,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -234,24 +185,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb
index 0fc93ecf..650c4f0b 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Netris Controller configuration properties. Knowledge base article to help you can be found here.
- class OsConfigurationNetrisController
+ class OsConfigurationNetrisController < ApiModelBase
# (Read-only) Host OS on which the Netris Controller is installed.
attr_accessor :host_os
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisController`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisController`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -142,61 +148,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -213,24 +164,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb
index 9e53f7ae..67760ae1 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Netris Softgate configuration properties. Follow instructions for retrieving the required details.
- class OsConfigurationNetrisSoftgate
+ class OsConfigurationNetrisSoftgate < ApiModelBase
# (Read-only) Host OS on which the Netris Softgate is installed.
attr_accessor :host_os
@@ -38,9 +38,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -67,9 +72,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisSoftgate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisSoftgate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -203,61 +209,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -274,24 +225,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/os_configuration_windows.rb b/BmcApi/lib/pnap_bmc_api/models/os_configuration_windows.rb
index b7b1a0c0..4fd58a4d 100644
--- a/BmcApi/lib/pnap_bmc_api/models/os_configuration_windows.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/os_configuration_windows.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,26 +15,36 @@
module BmcApi
# Windows OS configuration properties.
- class OsConfigurationWindows
+ class OsConfigurationWindows < ApiModelBase
# List of IPs allowed for RDP access to Windows OS. Supported in single IP, CIDR and range format. When undefined, RDP is disabled. To allow RDP access from any IP use 0.0.0.0/0. This will only be returned in response to provisioning a server.
attr_accessor :rdp_allowed_ips
+ # Use a Bring Your Own (BYO) Windows license. If true, the server is provisioned in trial mode, and you must activate your own license. If false (default), the server includes a managed Windows license billed by the platform.
+ attr_accessor :bring_your_own_license
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
- :'rdp_allowed_ips' => :'rdpAllowedIps'
+ :'rdp_allowed_ips' => :'rdpAllowedIps',
+ :'bring_your_own_license' => :'bringYourOwnLicense'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
def self.openapi_types
{
- :'rdp_allowed_ips' => :'Array'
+ :'rdp_allowed_ips' => :'Array',
+ :'bring_your_own_license' => :'Boolean'
}
end
@@ -52,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationWindows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationWindows`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -64,6 +75,12 @@ def initialize(attributes = {})
self.rdp_allowed_ips = value
end
end
+
+ if attributes.key?(:'bring_your_own_license')
+ self.bring_your_own_license = attributes[:'bring_your_own_license']
+ else
+ self.bring_your_own_license = false
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -105,7 +122,8 @@ def rdp_allowed_ips=(rdp_allowed_ips)
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
- rdp_allowed_ips == o.rdp_allowed_ips
+ rdp_allowed_ips == o.rdp_allowed_ips &&
+ bring_your_own_license == o.bring_your_own_license
end
# @see the `==` method
@@ -117,7 +135,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [rdp_allowed_ips].hash
+ [rdp_allowed_ips, bring_your_own_license].hash
end
# Builds the object from hash
@@ -143,61 +161,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -214,24 +177,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/private_network_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/private_network_configuration.rb
index 6323329f..1c56452b 100644
--- a/BmcApi/lib/pnap_bmc_api/models/private_network_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/private_network_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,14 +15,14 @@
module BmcApi
# Private network details of bare metal server.
- class PrivateNetworkConfiguration
+ class PrivateNetworkConfiguration < ApiModelBase
# Deprecated in favour of a common gateway address across all networks available under NetworkConfiguration.
The address of the gateway assigned / to assign to the server.
When used as part of request body, IP address has to be part of private network assigned to this server.
Gateway address also has to be assigned on an already deployed resource unless the `force` query parameter is true.
attr_accessor :gateway_address
# (Write-only) Determines the approach for configuring private network(s) for the server being provisioned. Currently this field should be set to `USE_OR_CREATE_DEFAULT`, `USER_DEFINED` or `NONE`.
attr_accessor :configuration_type
- # The list of private networks this server is member of. When this field is part of request body, it'll be used to specify the private networks to assign to this server upon provisioning. Used alongside the `USER_DEFINED` configurationType.
+ # The list of private networks this server belongs to. If this field is part of a request body, it will be used for specifying the private networks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
attr_accessor :private_networks
# Attribute mapping from ruby-style variable name to JSON key.
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PrivateNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PrivateNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -146,61 +152,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -217,24 +168,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/public_network_configuration.rb b/BmcApi/lib/pnap_bmc_api/models/public_network_configuration.rb
index 97512508..6918659e 100644
--- a/BmcApi/lib/pnap_bmc_api/models/public_network_configuration.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/public_network_configuration.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,8 +15,8 @@
module BmcApi
# Public network details of bare metal server.
- class PublicNetworkConfiguration
- # The list of public networks this server is member of. When this field is part of request body, it'll be used to specify the public networks to assign to this server upon provisioning.
+ class PublicNetworkConfiguration < ApiModelBase
+ # The list of public networks this server belongs to. If this field is part of a request body, it will be used for specifying the public networks to assign to this server on provision. Only IPv4 addresses can be specified.
attr_accessor :public_networks
# Attribute mapping from ruby-style variable name to JSON key.
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PublicNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PublicNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -124,61 +130,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -195,24 +146,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/quota.rb b/BmcApi/lib/pnap_bmc_api/models/quota.rb
index 1190ad62..041dc183 100644
--- a/BmcApi/lib/pnap_bmc_api/models/quota.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/quota.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Quota.
- class Quota
+ class Quota < ApiModelBase
# The ID of the Quota.
attr_accessor :id
@@ -75,9 +75,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -108,9 +113,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Quota`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Quota`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -233,6 +239,36 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] name Value to be assigned
+ def name=(name)
+ if name.nil?
+ fail ArgumentError, 'name cannot be nil'
+ end
+
+ @name = name
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] description Value to be assigned
+ def description=(description)
+ if description.nil?
+ fail ArgumentError, 'description cannot be nil'
+ end
+
+ @description = description
+ end
+
# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)
@@ -257,6 +293,16 @@ def limit=(limit)
@limit = limit
end
+ # Custom attribute writer method with validation
+ # @param [Object] unit Value to be assigned
+ def unit=(unit)
+ if unit.nil?
+ fail ArgumentError, 'unit cannot be nil'
+ end
+
+ @unit = unit
+ end
+
# Custom attribute writer method with validation
# @param [Object] used Value to be assigned
def used=(used)
@@ -271,6 +317,16 @@ def used=(used)
@used = used
end
+ # Custom attribute writer method with validation
+ # @param [Object] quota_edit_limit_request_details Value to be assigned
+ def quota_edit_limit_request_details=(quota_edit_limit_request_details)
+ if quota_edit_limit_request_details.nil?
+ fail ArgumentError, 'quota_edit_limit_request_details cannot be nil'
+ end
+
+ @quota_edit_limit_request_details = quota_edit_limit_request_details
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -321,61 +377,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -392,24 +393,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request.rb b/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request.rb
index a8ca690f..70778888 100644
--- a/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# A request to change the limit on a quota.
- class QuotaEditLimitRequest
+ class QuotaEditLimitRequest < ApiModelBase
# The new limit that is requested. Minimum allowed limit values: - 0 (Server, IPs) - 1000 (Network Storage)
attr_accessor :limit
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -186,61 +192,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -257,24 +208,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb b/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb
index 1e6f471c..be42a2ad 100644
--- a/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -14,7 +14,7 @@
require 'time'
module BmcApi
- class QuotaEditLimitRequestDetails
+ class QuotaEditLimitRequestDetails < ApiModelBase
# The new limit that is requested. Minimum allowed limit values: - 0 (Server, IPs) - 1000 (Network Storage)
attr_accessor :limit
@@ -33,9 +33,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -68,9 +73,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequestDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequestDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -168,6 +174,16 @@ def reason=(reason)
@reason = reason
end
+ # Custom attribute writer method with validation
+ # @param [Object] requested_on Value to be assigned
+ def requested_on=(requested_on)
+ if requested_on.nil?
+ fail ArgumentError, 'requested_on cannot be nil'
+ end
+
+ @requested_on = requested_on
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -213,61 +229,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -284,24 +245,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/relinquish_ip_block.rb b/BmcApi/lib/pnap_bmc_api/models/relinquish_ip_block.rb
index 3a8b40b9..0873bf08 100644
--- a/BmcApi/lib/pnap_bmc_api/models/relinquish_ip_block.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/relinquish_ip_block.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Object used to determine whether to relinquish ownership of the IP blocks upon unassignment from server or server deletion.
- class RelinquishIpBlock
+ class RelinquishIpBlock < ApiModelBase
# Determines whether the IPv4 and IPv6 blocks assigned to the server should be deleted or not.
attr_accessor :delete_ip_blocks
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::RelinquishIpBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::RelinquishIpBlock`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -124,61 +130,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -195,24 +146,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/reservation_transfer_details.rb b/BmcApi/lib/pnap_bmc_api/models/reservation_transfer_details.rb
new file mode 100644
index 00000000..8e36b839
--- /dev/null
+++ b/BmcApi/lib/pnap_bmc_api/models/reservation_transfer_details.rb
@@ -0,0 +1,166 @@
+=begin
+#Bare Metal Cloud API
+
+#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API. Deprovision servers, get or edit SSH key details, assign public IPs, assign servers to networks and a lot more. Manage your infrastructure more efficiently using just a few simple API calls.
Knowledge base articles to help you can be found here
All URLs are relative to (https://api.phoenixnap.com/bmc/v1/)
+
+The version of the OpenAPI document: 0.1
+Contact: support@phoenixnap.com
+Generated by: https://openapi-generator.tech
+Generator version: 7.20.0
+
+=end
+
+require 'date'
+require 'time'
+
+module BmcApi
+ # Reservation transfer details.
+ class ReservationTransferDetails < ApiModelBase
+ # ID of target server to transfer reservation to.
+ attr_accessor :target_server_id
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'target_server_id' => :'targetServerId'
+ }
+ end
+
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ acceptable_attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'target_server_id' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BmcApi::ReservationTransferDetails` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ReservationTransferDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'target_server_id')
+ self.target_server_id = attributes[:'target_server_id']
+ else
+ self.target_server_id = 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 @target_server_id.nil?
+ invalid_properties.push('invalid value for "target_server_id", target_server_id cannot be nil.')
+ end
+
+ 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'
+ return false if @target_server_id.nil?
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] target_server_id Value to be assigned
+ def target_server_id=(target_server_id)
+ if target_server_id.nil?
+ fail ArgumentError, 'target_server_id cannot be nil'
+ end
+
+ @target_server_id = target_server_id
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ target_server_id == o.target_server_id
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [target_server_id].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ 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[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ end
+
+end
diff --git a/BmcApi/lib/pnap_bmc_api/models/reset_result.rb b/BmcApi/lib/pnap_bmc_api/models/reset_result.rb
index 6c7f2f49..fc00adbc 100644
--- a/BmcApi/lib/pnap_bmc_api/models/reset_result.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/reset_result.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Result of a successful reset action.
- class ResetResult
+ class ResetResult < ApiModelBase
# Message describing the reset result.
attr_accessor :result
@@ -33,9 +33,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -61,9 +66,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ResetResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ResetResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -103,6 +109,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] result Value to be assigned
+ def result=(result)
+ if result.nil?
+ fail ArgumentError, 'result cannot be nil'
+ end
+
+ @result = result
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -148,61 +164,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -219,24 +180,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server.rb b/BmcApi/lib/pnap_bmc_api/models/server.rb
index aeca6d06..237743e5 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Bare metal server.
- class Server
+ class Server < ApiModelBase
# The unique identifier of the server.
attr_accessor :id
@@ -28,13 +28,13 @@ class Server
# Description of server.
attr_accessor :description
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
attr_accessor :os
- # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, s4.x6.c6.large or s4.x6.m6.xlarge.
+ # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c4.small`, `d1.c4.medium`, `d1.c4.large`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, `d3.g3.c2.medium`, `s4.x6.c6.large`, `s4.x6.m6.xlarge`, `s5.x6.c3.medium`, `s5.x6.c3.large`, `s5.x6.c8.medium`, `s5.x6.c9.medium`, `s5.x6.c8.large`, `s5.x6.c9.large`, `s5.x6.m8.xlarge`, `s5.x6.m9.xlarge`, `s4.c3.medium`, `s4.c6.medium`, `s4.c6.large`, `s4.c6.xlarge`, `s4.s2.large`, `a2.c9.large` or `a2.c9.xlarge`.
attr_accessor :type
- # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
+ # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`.
attr_accessor :location
# A description of the machine CPU.
@@ -130,9 +130,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -183,9 +188,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Server`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Server`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -363,7 +369,7 @@ def list_invalid_properties
end
if @hostname.to_s.length < 1
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -477,6 +483,26 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] status Value to be assigned
+ def status=(status)
+ if status.nil?
+ fail ArgumentError, 'status cannot be nil'
+ end
+
+ @status = status
+ end
+
# Custom attribute writer method with validation
# @param [Object] hostname Value to be assigned
def hostname=(hostname)
@@ -489,7 +515,7 @@ def hostname=(hostname)
end
if hostname.to_s.length < 1
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -514,6 +540,36 @@ def description=(description)
@description = description
end
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] cpu Value to be assigned
+ def cpu=(cpu)
+ if cpu.nil?
+ fail ArgumentError, 'cpu cannot be nil'
+ end
+
+ @cpu = cpu
+ end
+
# Custom attribute writer method with validation
# @param [Object] cpu_count Value to be assigned
def cpu_count=(cpu_count)
@@ -556,6 +612,26 @@ def cpu_frequency=(cpu_frequency)
@cpu_frequency = cpu_frequency
end
+ # Custom attribute writer method with validation
+ # @param [Object] ram Value to be assigned
+ def ram=(ram)
+ if ram.nil?
+ fail ArgumentError, 'ram cannot be nil'
+ end
+
+ @ram = ram
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] storage Value to be assigned
+ def storage=(storage)
+ if storage.nil?
+ fail ArgumentError, 'storage cannot be nil'
+ end
+
+ @storage = storage
+ end
+
# Custom attribute writer method with validation
# @param [Object] private_ip_addresses Value to be assigned
def private_ip_addresses=(private_ip_addresses)
@@ -584,6 +660,36 @@ def public_ip_addresses=(public_ip_addresses)
@public_ip_addresses = public_ip_addresses
end
+ # Custom attribute writer method with validation
+ # @param [Object] pricing_model Value to be assigned
+ def pricing_model=(pricing_model)
+ if pricing_model.nil?
+ fail ArgumentError, 'pricing_model cannot be nil'
+ end
+
+ @pricing_model = pricing_model
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] network_configuration Value to be assigned
+ def network_configuration=(network_configuration)
+ if network_configuration.nil?
+ fail ArgumentError, 'network_configuration cannot be nil'
+ end
+
+ @network_configuration = network_configuration
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] storage_configuration Value to be assigned
+ def storage_configuration=(storage_configuration)
+ if storage_configuration.nil?
+ fail ArgumentError, 'storage_configuration cannot be nil'
+ end
+
+ @storage_configuration = storage_configuration
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -654,61 +760,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -725,24 +776,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_create.rb b/BmcApi/lib/pnap_bmc_api/models/server_create.rb
index 45911dba..7183040a 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_create.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_create.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,20 +15,20 @@
module BmcApi
# Provision bare metal server.
- class ServerCreate
+ class ServerCreate < ApiModelBase
# Hostname of server.
attr_accessor :hostname
# Description of server.
attr_accessor :description
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
attr_accessor :os
- # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`, s4.x6.c6.large or s4.x6.m6.xlarge.
+ # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c4.small`, `d1.c4.medium`, `d1.c4.large`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `a1.c5.xlarge`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge`, `d3.g2.c3.xlarge`,`d3.g3.c2.medium`, `s4.x6.c6.large`, `s4.x6.m6.xlarge`, `s5.x6.c3.medium`, `s5.x6.c3.large`, `s5.x6.c8.medium`, `s5.x6.c9.medium`, `s5.x6.c8.large`, `s5.x6.c9.large`, `s5.x6.m8.xlarge`, `s5.x6.m9.xlarge`, `s4.c3.medium`, `s4.c6.medium`, `s4.c6.large`, `s4.c6.xlarge`, `s4.s2.large`, `a2.c9.large` or `a2.c9.xlarge`.
attr_accessor :type
- # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
+ # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`.
attr_accessor :location
# Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
@@ -79,9 +79,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -119,9 +124,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -221,7 +227,7 @@ def list_invalid_properties
end
if @hostname.to_s.length < 1
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -275,7 +281,7 @@ def hostname=(hostname)
end
if hostname.to_s.length < 1
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -300,6 +306,36 @@ def description=(description)
@description = description
end
+ # Custom attribute writer method with validation
+ # @param [Object] os Value to be assigned
+ def os=(os)
+ if os.nil?
+ fail ArgumentError, 'os cannot be nil'
+ end
+
+ @os = os
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] type Value to be assigned
+ def type=(type)
+ if type.nil?
+ fail ArgumentError, 'type cannot be nil'
+ end
+
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] location Value to be assigned
+ def location=(location)
+ if location.nil?
+ fail ArgumentError, 'location cannot be nil'
+ end
+
+ @location = location
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -357,61 +393,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -428,24 +409,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_ip_block.rb b/BmcApi/lib/pnap_bmc_api/models/server_ip_block.rb
index 548ae672..750f6031 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_ip_block.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_ip_block.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# IP block assigned to server
- class ServerIpBlock
+ class ServerIpBlock < ApiModelBase
# The IP block's ID.
attr_accessor :id
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerIpBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerIpBlock`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -95,6 +101,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -139,61 +155,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -210,24 +171,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_network_update.rb b/BmcApi/lib/pnap_bmc_api/models/server_network_update.rb
index 47448d59..761602a4 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_network_update.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_network_update.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,8 +15,8 @@
module BmcApi
# Update network details of bare metal server.
- class ServerNetworkUpdate
- # List of IPs to be associated to the server.
Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). IPs must be within the network's range.
Setting the `force` query parameter to `true` allows you to: - Assign no specific IP addresses by designating an empty array of IPs.
- Assign one or more IP addresses which are already configured on other resource(s) in network.
- Assign IP addresses which are considered as reserved in network.
+ class ServerNetworkUpdate < ApiModelBase
+ # List of IPs to be associated to the server.
Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All IPs must be within the network's range.
Setting the `force` query parameter to `true` allows you to: - Assign no specific IP addresses by designating an empty array of IPs.
- Assign one or more IP addresses which are already configured on other resource(s) in network.
- Assign IP addresses which are considered as reserved in network.
attr_accessor :ips
# Attribute mapping from ruby-style variable name to JSON key.
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -124,61 +130,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -195,24 +146,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_patch.rb b/BmcApi/lib/pnap_bmc_api/models/server_patch.rb
index 5b11db68..76bb8388 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_patch.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_patch.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Patch bare metal server.
- class ServerPatch
+ class ServerPatch < ApiModelBase
# Description of server.
attr_accessor :description
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -87,7 +93,7 @@ def list_invalid_properties
end
if !@hostname.nil? && @hostname.to_s.length < 1
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
@@ -135,7 +141,7 @@ def hostname=(hostname)
end
if hostname.to_s.length < 1
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
@@ -190,61 +196,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -261,24 +212,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_private_network.rb b/BmcApi/lib/pnap_bmc_api/models/server_private_network.rb
index 245e1a62..0c9af142 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_private_network.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_private_network.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Private network details of bare metal server.
- class ServerPrivateNetwork
+ class ServerPrivateNetwork < ApiModelBase
# The network identifier.
attr_accessor :id
@@ -28,19 +28,28 @@ class ServerPrivateNetwork
# (Read-only) The status of the network.
attr_accessor :status_description
+ # (Read-only) The VLAN on which this network has been configured within the network switch.
+ attr_accessor :vlan_id
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'id' => :'id',
:'ips' => :'ips',
:'dhcp' => :'dhcp',
- :'status_description' => :'statusDescription'
+ :'status_description' => :'statusDescription',
+ :'vlan_id' => :'vlanId'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -49,7 +58,8 @@ def self.openapi_types
:'id' => :'String',
:'ips' => :'Array',
:'dhcp' => :'Boolean',
- :'status_description' => :'String'
+ :'status_description' => :'String',
+ :'vlan_id' => :'Integer'
}
end
@@ -67,9 +77,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPrivateNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPrivateNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -95,6 +106,10 @@ def initialize(attributes = {})
if attributes.key?(:'status_description')
self.status_description = attributes[:'status_description']
end
+
+ if attributes.key?(:'vlan_id')
+ self.vlan_id = attributes[:'vlan_id']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -122,6 +137,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
# Custom attribute writer method with validation
# @param [Object] ips Value to be assigned
def ips=(ips)
@@ -144,7 +169,8 @@ def ==(o)
id == o.id &&
ips == o.ips &&
dhcp == o.dhcp &&
- status_description == o.status_description
+ status_description == o.status_description &&
+ vlan_id == o.vlan_id
end
# @see the `==` method
@@ -156,7 +182,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, ips, dhcp, status_description].hash
+ [id, ips, dhcp, status_description, vlan_id].hash
end
# Builds the object from hash
@@ -182,61 +208,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -253,24 +224,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_provision.rb b/BmcApi/lib/pnap_bmc_api/models/server_provision.rb
index d4a2703e..9024b008 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_provision.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_provision.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,14 +15,14 @@
module BmcApi
# Provision bare metal server.
- class ServerProvision
+ class ServerProvision < ApiModelBase
# Hostname of server.
attr_accessor :hostname
# Description of server.
attr_accessor :description
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`,`netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
attr_accessor :os
# Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
@@ -63,9 +63,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -99,9 +104,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -179,7 +185,7 @@ def list_invalid_properties
end
if @hostname.to_s.length < 1
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -223,7 +229,7 @@ def hostname=(hostname)
end
if hostname.to_s.length < 1
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -248,6 +254,16 @@ def description=(description)
@description = description
end
+ # Custom attribute writer method with validation
+ # @param [Object] os Value to be assigned
+ def os=(os)
+ if os.nil?
+ fail ArgumentError, 'os cannot be nil'
+ end
+
+ @os = os
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -301,61 +317,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -372,24 +333,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_public_network.rb b/BmcApi/lib/pnap_bmc_api/models/server_public_network.rb
index 76ab15c9..635a6fdb 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_public_network.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_public_network.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,11 +15,11 @@
module BmcApi
# Public network details of bare metal server.
- class ServerPublicNetwork
+ class ServerPublicNetwork < ApiModelBase
# The network identifier.
attr_accessor :id
- # Configurable/configured IPs on the server.
At least 1 IP address is required. Valid IP format is single IP addresses. All IPs must be within the network's range.
Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.
Additionally, setting the `force` query parameter to `true` allows you to: - Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network.
- Assign one or more IP addresses which are already configured on other resource(s) in network.
+ # Configurable/configured IPs on the server.
At least 1 IP address is required. Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All IPs must be within the network's range.
Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.
Additionally, setting the `force` query parameter to `true` allows you to: - Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network.
- Assign one or more IP addresses which are already configured on other resource(s) in network.
attr_accessor :ips
# (Read-only) The status of the assignment to the network.
@@ -28,19 +28,28 @@ class ServerPublicNetwork
# (Write-only) Requests Stateless Address Autoconfiguration (SLAAC). Applicable for Network which contains IPv6 block(s).
attr_accessor :compute_slaac_ip
+ # (Read-only) The VLAN on which this network has been configured within the network switch.
+ attr_accessor :vlan_id
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'id' => :'id',
:'ips' => :'ips',
:'status_description' => :'statusDescription',
- :'compute_slaac_ip' => :'computeSlaacIp'
+ :'compute_slaac_ip' => :'computeSlaacIp',
+ :'vlan_id' => :'vlanId'
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -49,7 +58,8 @@ def self.openapi_types
:'id' => :'String',
:'ips' => :'Array',
:'status_description' => :'String',
- :'compute_slaac_ip' => :'Boolean'
+ :'compute_slaac_ip' => :'Boolean',
+ :'vlan_id' => :'Integer'
}
end
@@ -67,9 +77,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -93,6 +104,10 @@ def initialize(attributes = {})
if attributes.key?(:'compute_slaac_ip')
self.compute_slaac_ip = attributes[:'compute_slaac_ip']
end
+
+ if attributes.key?(:'vlan_id')
+ self.vlan_id = attributes[:'vlan_id']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -115,6 +130,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -123,7 +148,8 @@ def ==(o)
id == o.id &&
ips == o.ips &&
status_description == o.status_description &&
- compute_slaac_ip == o.compute_slaac_ip
+ compute_slaac_ip == o.compute_slaac_ip &&
+ vlan_id == o.vlan_id
end
# @see the `==` method
@@ -135,7 +161,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, ips, status_description, compute_slaac_ip].hash
+ [id, ips, status_description, compute_slaac_ip, vlan_id].hash
end
# Builds the object from hash
@@ -161,61 +187,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -232,24 +203,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_reserve.rb b/BmcApi/lib/pnap_bmc_api/models/server_reserve.rb
index 7e389058..39f159a9 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_reserve.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_reserve.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Bare metal server reservation.
- class ServerReserve
+ class ServerReserve < ApiModelBase
# Server pricing model. Currently this field should be set to `ONE_MONTH_RESERVATION`, `TWELVE_MONTHS_RESERVATION`, `TWENTY_FOUR_MONTHS_RESERVATION` or `THIRTY_SIX_MONTHS_RESERVATION`.
attr_accessor :pricing_model
@@ -26,9 +26,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -52,9 +57,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReserve`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReserve`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -86,6 +92,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] pricing_model Value to be assigned
+ def pricing_model=(pricing_model)
+ if pricing_model.nil?
+ fail ArgumentError, 'pricing_model cannot be nil'
+ end
+
+ @pricing_model = pricing_model
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -129,61 +145,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -200,24 +161,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/server_reset.rb b/BmcApi/lib/pnap_bmc_api/models/server_reset.rb
index 91c55fb6..3de7430c 100644
--- a/BmcApi/lib/pnap_bmc_api/models/server_reset.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/server_reset.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# Reset bare metal server.
- class ServerReset
+ class ServerReset < ApiModelBase
# Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
attr_accessor :install_default_ssh_keys
@@ -37,9 +37,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -66,9 +71,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -157,61 +163,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -228,24 +179,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/ssh_key.rb b/BmcApi/lib/pnap_bmc_api/models/ssh_key.rb
index a98a40e5..7a553c7a 100644
--- a/BmcApi/lib/pnap_bmc_api/models/ssh_key.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/ssh_key.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# SSH Key.
- class SshKey
+ class SshKey < ApiModelBase
# The unique identifier of the SSH Key.
attr_accessor :id
@@ -50,9 +50,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -82,9 +87,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -182,6 +188,76 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] id Value to be assigned
+ def id=(id)
+ if id.nil?
+ fail ArgumentError, 'id cannot be nil'
+ end
+
+ @id = id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] default Value to be assigned
+ def default=(default)
+ if default.nil?
+ fail ArgumentError, 'default cannot be nil'
+ end
+
+ @default = default
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] name Value to be assigned
+ def name=(name)
+ if name.nil?
+ fail ArgumentError, 'name cannot be nil'
+ end
+
+ @name = name
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] key Value to be assigned
+ def key=(key)
+ if key.nil?
+ fail ArgumentError, 'key cannot be nil'
+ end
+
+ @key = key
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] fingerprint Value to be assigned
+ def fingerprint=(fingerprint)
+ if fingerprint.nil?
+ fail ArgumentError, 'fingerprint cannot be nil'
+ end
+
+ @fingerprint = fingerprint
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] created_on Value to be assigned
+ def created_on=(created_on)
+ if created_on.nil?
+ fail ArgumentError, 'created_on cannot be nil'
+ end
+
+ @created_on = created_on
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] last_updated_on Value to be assigned
+ def last_updated_on=(last_updated_on)
+ if last_updated_on.nil?
+ fail ArgumentError, 'last_updated_on cannot be nil'
+ end
+
+ @last_updated_on = last_updated_on
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -231,61 +307,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -302,24 +323,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/ssh_key_create.rb b/BmcApi/lib/pnap_bmc_api/models/ssh_key_create.rb
index b002594a..f28e0030 100644
--- a/BmcApi/lib/pnap_bmc_api/models/ssh_key_create.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/ssh_key_create.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# SSH key creation model.
- class SshKeyCreate
+ class SshKeyCreate < ApiModelBase
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
attr_accessor :default
@@ -34,9 +34,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -62,9 +67,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -106,7 +112,7 @@ def list_invalid_properties
end
if @name.to_s.length < 1
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^(?!\s*$).+/)
@@ -140,6 +146,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] default Value to be assigned
+ def default=(default)
+ if default.nil?
+ fail ArgumentError, 'default cannot be nil'
+ end
+
+ @default = default
+ end
+
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
@@ -152,7 +168,7 @@ def name=(name)
end
if name.to_s.length < 1
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^(?!\s*$).+/)
@@ -223,61 +239,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = BmcApi.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
@@ -294,24 +255,6 @@ def to_hash
hash
end
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
end
end
diff --git a/BmcApi/lib/pnap_bmc_api/models/ssh_key_update.rb b/BmcApi/lib/pnap_bmc_api/models/ssh_key_update.rb
index 95e68873..03dd8bd4 100644
--- a/BmcApi/lib/pnap_bmc_api/models/ssh_key_update.rb
+++ b/BmcApi/lib/pnap_bmc_api/models/ssh_key_update.rb
@@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 7.2.0
+Generator version: 7.20.0
=end
@@ -15,7 +15,7 @@
module BmcApi
# SSH key modification model.
- class SshKeyUpdate
+ class SshKeyUpdate < ApiModelBase
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
attr_accessor :default
@@ -30,9 +30,14 @@ def self.attribute_map
}
end
+ # Returns attribute mapping this model knows about
+ def self.acceptable_attribute_map
+ attribute_map
+ end
+
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
- attribute_map.values
+ acceptable_attribute_map.values
end
# Attribute type mapping.
@@ -57,9 +62,10 @@ def initialize(attributes = {})
end
# check to see if the attribute exists and convert string to symbol for hash key
+ acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ if (!acceptable_attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -95,7 +101,7 @@ def list_invalid_properties
end
if @name.to_s.length < 1
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
end
pattern = Regexp.new(/^(?!\s*$).+/)
@@ -118,6 +124,16 @@ def valid?
true
end
+ # Custom attribute writer method with validation
+ # @param [Object] default Value to be assigned
+ def default=(default)
+ if default.nil?
+ fail ArgumentError, 'default cannot be nil'
+ end
+
+ @default = default
+ end
+
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
@@ -130,7 +146,7 @@ def name=(name)
end
if name.to_s.length < 1
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
end
pattern = Regexp.new(/^(?!\s*$).+/)
@@ -185,61 +201,6 @@ def self.build_from_hash(attributes)
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 self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?