pnap_billing_api 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/VERSION +1 -1
- data/docs/BandwidthRecord.md +4 -2
- data/docs/LocationAvailabilityDetail.md +1 -1
- data/docs/OperatingSystemRecord.md +4 -2
- data/docs/PackageDetails.md +20 -0
- data/docs/PackageQuantity.md +20 -0
- data/docs/PricingPlan.md +3 -1
- data/docs/ProductAvailabilityApi.md +4 -4
- data/docs/ProductLocationEnum.md +15 -0
- data/docs/PublicSubnetRecord.md +4 -2
- data/docs/Quantity.md +20 -0
- data/docs/QuantityUnitEnum.md +15 -0
- data/docs/RatedUsageRecord.md +4 -2
- data/docs/Reservation.md +10 -2
- data/docs/ReservationDetails.md +20 -0
- data/docs/ReservationRequest.md +3 -1
- data/docs/ReservationStateEnum.md +15 -0
- data/docs/ReservationTerm.md +20 -0
- data/docs/ReservationsApi.md +2 -2
- data/docs/ServerRecord.md +4 -2
- data/docs/StorageDetails.md +5 -5
- data/docs/StorageRecord.md +4 -2
- data/docs/Utilization.md +20 -0
- data/lib/pnap_billing_api/api/billing_configurations_api.rb +2 -2
- data/lib/pnap_billing_api/api/product_availability_api.rb +14 -6
- data/lib/pnap_billing_api/api/products_api.rb +2 -2
- data/lib/pnap_billing_api/api/rated_usage_api.rb +3 -3
- data/lib/pnap_billing_api/api/reservations_api.rb +7 -7
- data/lib/pnap_billing_api/api_client.rb +17 -14
- data/lib/pnap_billing_api/api_error.rb +1 -1
- data/lib/pnap_billing_api/api_model_base.rb +88 -0
- data/lib/pnap_billing_api/configuration.rb +11 -1
- data/lib/pnap_billing_api/models/applicable_discount_details.rb +41 -78
- data/lib/pnap_billing_api/models/applicable_discounts.rb +11 -78
- data/lib/pnap_billing_api/models/bandwidth_details.rb +31 -78
- data/lib/pnap_billing_api/models/bandwidth_record.rb +151 -93
- data/lib/pnap_billing_api/models/configuration_details.rb +11 -78
- data/lib/pnap_billing_api/models/credit_details.rb +5 -7
- data/lib/pnap_billing_api/models/credit_details_base.rb +31 -78
- data/lib/pnap_billing_api/models/credit_type_enum.rb +1 -1
- data/lib/pnap_billing_api/models/discount_details.rb +41 -78
- data/lib/pnap_billing_api/models/discount_type_enum.rb +1 -1
- data/lib/pnap_billing_api/models/error.rb +21 -78
- data/lib/pnap_billing_api/models/gpu_configuration_metadata.rb +11 -78
- data/lib/pnap_billing_api/models/location_availability_detail.rb +52 -79
- data/lib/pnap_billing_api/models/location_enum.rb +1 -1
- data/lib/pnap_billing_api/models/operating_system_details.rb +31 -78
- data/lib/pnap_billing_api/models/operating_system_record.rb +151 -93
- data/lib/pnap_billing_api/models/package_details.rb +179 -0
- data/lib/pnap_billing_api/models/package_quantity.rb +193 -0
- data/lib/pnap_billing_api/models/package_unit_enum.rb +1 -1
- data/lib/pnap_billing_api/models/price_unit_enum.rb +3 -2
- data/lib/pnap_billing_api/models/pricing_plan.rb +56 -84
- data/lib/pnap_billing_api/models/product.rb +31 -78
- data/lib/pnap_billing_api/models/product_availability.rb +41 -78
- data/lib/pnap_billing_api/models/product_category_enum.rb +1 -1
- data/lib/pnap_billing_api/models/product_location_enum.rb +44 -0
- data/lib/pnap_billing_api/models/products_get200_response_inner.rb +1 -2
- data/lib/pnap_billing_api/models/promo_credit_details.rb +51 -78
- data/lib/pnap_billing_api/models/public_subnet_details.rb +31 -78
- data/lib/pnap_billing_api/models/public_subnet_record.rb +151 -93
- data/lib/pnap_billing_api/models/quantity.rb +223 -0
- data/lib/pnap_billing_api/models/quantity_unit_enum.rb +40 -0
- data/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb +1 -2
- data/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb +1 -1
- data/lib/pnap_billing_api/models/rated_usage_record.rb +141 -93
- data/lib/pnap_billing_api/models/reservation.rb +186 -83
- data/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb +11 -78
- data/lib/pnap_billing_api/models/reservation_details.rb +158 -0
- data/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb +1 -1
- data/lib/pnap_billing_api/models/reservation_model_enum.rb +3 -2
- data/lib/pnap_billing_api/models/reservation_product_category_enum.rb +3 -2
- data/lib/pnap_billing_api/models/reservation_request.rb +51 -82
- data/lib/pnap_billing_api/models/reservation_state_enum.rb +44 -0
- data/lib/pnap_billing_api/models/reservation_term.rb +214 -0
- data/lib/pnap_billing_api/models/server_details.rb +31 -78
- data/lib/pnap_billing_api/models/server_product.rb +41 -78
- data/lib/pnap_billing_api/models/server_product_metadata.rb +81 -78
- data/lib/pnap_billing_api/models/server_record.rb +151 -93
- data/lib/pnap_billing_api/models/storage_details.rb +21 -113
- data/lib/pnap_billing_api/models/storage_record.rb +151 -93
- data/lib/pnap_billing_api/models/system_credit_cause_enum.rb +1 -1
- data/lib/pnap_billing_api/models/system_credit_details.rb +41 -78
- data/lib/pnap_billing_api/models/threshold_configuration_details.rb +21 -78
- data/lib/pnap_billing_api/models/utilization.rb +208 -0
- data/lib/pnap_billing_api/version.rb +1 -2
- data/lib/pnap_billing_api.rb +11 -1
- data/pnap_billing_api.gemspec +6 -6
- data/spec/api/billing_configurations_api_spec.rb +1 -1
- data/spec/api/product_availability_api_spec.rb +3 -3
- data/spec/api/products_api_spec.rb +1 -1
- data/spec/api/rated_usage_api_spec.rb +1 -1
- data/spec/api/reservations_api_spec.rb +1 -1
- data/spec/models/applicable_discount_details_spec.rb +2 -2
- data/spec/models/applicable_discounts_spec.rb +2 -2
- data/spec/models/bandwidth_details_spec.rb +2 -2
- data/spec/models/bandwidth_record_spec.rb +8 -2
- data/spec/models/configuration_details_spec.rb +2 -2
- data/spec/models/credit_details_base_spec.rb +2 -2
- data/spec/models/credit_details_spec.rb +1 -1
- data/spec/models/credit_type_enum_spec.rb +2 -2
- data/spec/models/discount_details_spec.rb +2 -2
- data/spec/models/discount_type_enum_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/gpu_configuration_metadata_spec.rb +2 -2
- data/spec/models/location_availability_detail_spec.rb +2 -2
- data/spec/models/location_enum_spec.rb +2 -2
- data/spec/models/operating_system_details_spec.rb +2 -2
- data/spec/models/operating_system_record_spec.rb +8 -2
- data/spec/models/package_details_spec.rb +42 -0
- data/spec/models/package_quantity_spec.rb +42 -0
- data/spec/models/package_unit_enum_spec.rb +2 -2
- data/spec/models/price_unit_enum_spec.rb +2 -2
- data/spec/models/pricing_plan_spec.rb +9 -3
- data/spec/models/product_availability_spec.rb +2 -2
- data/spec/models/product_category_enum_spec.rb +2 -2
- data/spec/models/product_location_enum_spec.rb +30 -0
- data/spec/models/product_spec.rb +2 -2
- data/spec/models/products_get200_response_inner_spec.rb +1 -1
- data/spec/models/promo_credit_details_spec.rb +2 -2
- data/spec/models/public_subnet_details_spec.rb +2 -2
- data/spec/models/public_subnet_record_spec.rb +8 -2
- data/spec/models/quantity_spec.rb +42 -0
- data/spec/models/quantity_unit_enum_spec.rb +30 -0
- data/spec/models/rated_usage_get200_response_inner_spec.rb +1 -1
- data/spec/models/rated_usage_product_category_enum_spec.rb +2 -2
- data/spec/models/rated_usage_record_spec.rb +8 -2
- data/spec/models/reservation_auto_renew_disable_request_spec.rb +2 -2
- data/spec/models/reservation_details_spec.rb +42 -0
- data/spec/models/reservation_invoicing_model_enum_spec.rb +2 -2
- data/spec/models/reservation_model_enum_spec.rb +2 -2
- data/spec/models/reservation_product_category_enum_spec.rb +2 -2
- data/spec/models/reservation_request_spec.rb +8 -2
- data/spec/models/reservation_spec.rb +26 -2
- data/spec/models/reservation_state_enum_spec.rb +30 -0
- data/spec/models/reservation_term_spec.rb +42 -0
- data/spec/models/server_details_spec.rb +2 -2
- data/spec/models/server_product_metadata_spec.rb +2 -2
- data/spec/models/server_product_spec.rb +2 -2
- data/spec/models/server_record_spec.rb +8 -2
- data/spec/models/storage_details_spec.rb +2 -2
- data/spec/models/storage_record_spec.rb +8 -2
- data/spec/models/system_credit_cause_enum_spec.rb +2 -2
- data/spec/models/system_credit_details_spec.rb +2 -2
- data/spec/models/threshold_configuration_details_spec.rb +2 -2
- data/spec/models/utilization_spec.rb +42 -0
- data/spec/spec_helper.rb +1 -1
- metadata +82 -41
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Billing API
|
|
3
|
+
|
|
4
|
+
#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.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/phoenixnap-bare-metal-cloud-billing-models' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/billing/v1/)</b>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1
|
|
7
|
+
Contact: support@phoenixnap.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module BillingApi
|
|
17
|
+
class Utilization < ApiModelBase
|
|
18
|
+
attr_accessor :quantity
|
|
19
|
+
|
|
20
|
+
attr_accessor :percentage
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'quantity' => :'quantity',
|
|
26
|
+
:'percentage' => :'percentage'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'quantity' => :'Quantity',
|
|
44
|
+
:'percentage' => :'Float'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::Utilization` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
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
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'quantity')
|
|
71
|
+
self.quantity = attributes[:'quantity']
|
|
72
|
+
else
|
|
73
|
+
self.quantity = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'percentage')
|
|
77
|
+
self.percentage = attributes[:'percentage']
|
|
78
|
+
else
|
|
79
|
+
self.percentage = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @quantity.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @percentage.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "percentage", percentage cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if @percentage > 100
|
|
97
|
+
invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if @percentage < 0
|
|
101
|
+
invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
invalid_properties
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Check to see if the all the properties in the model are valid
|
|
108
|
+
# @return true if the model is valid
|
|
109
|
+
def valid?
|
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
111
|
+
return false if @quantity.nil?
|
|
112
|
+
return false if @percentage.nil?
|
|
113
|
+
return false if @percentage > 100
|
|
114
|
+
return false if @percentage < 0
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] quantity Value to be assigned
|
|
120
|
+
def quantity=(quantity)
|
|
121
|
+
if quantity.nil?
|
|
122
|
+
fail ArgumentError, 'quantity cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@quantity = quantity
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Custom attribute writer method with validation
|
|
129
|
+
# @param [Object] percentage Value to be assigned
|
|
130
|
+
def percentage=(percentage)
|
|
131
|
+
if percentage.nil?
|
|
132
|
+
fail ArgumentError, 'percentage cannot be nil'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if percentage > 100
|
|
136
|
+
fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if percentage < 0
|
|
140
|
+
fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.'
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
@percentage = percentage
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Checks equality by comparing each attribute.
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def ==(o)
|
|
149
|
+
return true if self.equal?(o)
|
|
150
|
+
self.class == o.class &&
|
|
151
|
+
quantity == o.quantity &&
|
|
152
|
+
percentage == o.percentage
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# @see the `==` method
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def eql?(o)
|
|
158
|
+
self == o
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Calculates hash code according to all attributes.
|
|
162
|
+
# @return [Integer] Hash code
|
|
163
|
+
def hash
|
|
164
|
+
[quantity, percentage].hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Builds the object from hash
|
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
169
|
+
# @return [Object] Returns the model itself
|
|
170
|
+
def self.build_from_hash(attributes)
|
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
173
|
+
transformed_hash = {}
|
|
174
|
+
openapi_types.each_pair do |key, type|
|
|
175
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
176
|
+
transformed_hash["#{key}"] = nil
|
|
177
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
178
|
+
# check to ensure the input is an array given that the attribute
|
|
179
|
+
# is documented as an array but the input is not
|
|
180
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
181
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
182
|
+
end
|
|
183
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
new(transformed_hash)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
if value.nil?
|
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
hash[param] = _to_hash(value)
|
|
202
|
+
end
|
|
203
|
+
hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
data/lib/pnap_billing_api.rb
CHANGED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
# Common files
|
|
14
14
|
require 'pnap_billing_api/api_client'
|
|
15
15
|
require 'pnap_billing_api/api_error'
|
|
16
|
+
require 'pnap_billing_api/api_model_base'
|
|
16
17
|
require 'pnap_billing_api/version'
|
|
17
18
|
require 'pnap_billing_api/configuration'
|
|
18
19
|
|
|
@@ -33,25 +34,33 @@ require 'pnap_billing_api/models/location_availability_detail'
|
|
|
33
34
|
require 'pnap_billing_api/models/location_enum'
|
|
34
35
|
require 'pnap_billing_api/models/operating_system_details'
|
|
35
36
|
require 'pnap_billing_api/models/operating_system_record'
|
|
37
|
+
require 'pnap_billing_api/models/package_details'
|
|
38
|
+
require 'pnap_billing_api/models/package_quantity'
|
|
36
39
|
require 'pnap_billing_api/models/package_unit_enum'
|
|
37
40
|
require 'pnap_billing_api/models/price_unit_enum'
|
|
38
41
|
require 'pnap_billing_api/models/pricing_plan'
|
|
39
42
|
require 'pnap_billing_api/models/product'
|
|
40
43
|
require 'pnap_billing_api/models/product_availability'
|
|
41
44
|
require 'pnap_billing_api/models/product_category_enum'
|
|
45
|
+
require 'pnap_billing_api/models/product_location_enum'
|
|
42
46
|
require 'pnap_billing_api/models/products_get200_response_inner'
|
|
43
47
|
require 'pnap_billing_api/models/promo_credit_details'
|
|
44
48
|
require 'pnap_billing_api/models/public_subnet_details'
|
|
45
49
|
require 'pnap_billing_api/models/public_subnet_record'
|
|
50
|
+
require 'pnap_billing_api/models/quantity'
|
|
51
|
+
require 'pnap_billing_api/models/quantity_unit_enum'
|
|
46
52
|
require 'pnap_billing_api/models/rated_usage_get200_response_inner'
|
|
47
53
|
require 'pnap_billing_api/models/rated_usage_product_category_enum'
|
|
48
54
|
require 'pnap_billing_api/models/rated_usage_record'
|
|
49
55
|
require 'pnap_billing_api/models/reservation'
|
|
50
56
|
require 'pnap_billing_api/models/reservation_auto_renew_disable_request'
|
|
57
|
+
require 'pnap_billing_api/models/reservation_details'
|
|
51
58
|
require 'pnap_billing_api/models/reservation_invoicing_model_enum'
|
|
52
59
|
require 'pnap_billing_api/models/reservation_model_enum'
|
|
53
60
|
require 'pnap_billing_api/models/reservation_product_category_enum'
|
|
54
61
|
require 'pnap_billing_api/models/reservation_request'
|
|
62
|
+
require 'pnap_billing_api/models/reservation_state_enum'
|
|
63
|
+
require 'pnap_billing_api/models/reservation_term'
|
|
55
64
|
require 'pnap_billing_api/models/server_details'
|
|
56
65
|
require 'pnap_billing_api/models/server_product'
|
|
57
66
|
require 'pnap_billing_api/models/server_product_metadata'
|
|
@@ -61,6 +70,7 @@ require 'pnap_billing_api/models/storage_record'
|
|
|
61
70
|
require 'pnap_billing_api/models/system_credit_cause_enum'
|
|
62
71
|
require 'pnap_billing_api/models/system_credit_details'
|
|
63
72
|
require 'pnap_billing_api/models/threshold_configuration_details'
|
|
73
|
+
require 'pnap_billing_api/models/utilization'
|
|
64
74
|
|
|
65
75
|
# APIs
|
|
66
76
|
require 'pnap_billing_api/api/billing_configurations_api'
|
data/pnap_billing_api.gemspec
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
The version of the OpenAPI document: 0.1
|
|
9
9
|
Contact: support@phoenixnap.com
|
|
10
10
|
Generated by: https://openapi-generator.tech
|
|
11
|
-
|
|
11
|
+
Generator version: 7.20.0
|
|
12
12
|
|
|
13
13
|
=end
|
|
14
14
|
|
|
@@ -19,14 +19,14 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.name = "pnap_billing_api"
|
|
20
20
|
s.version = BillingApi::VERSION
|
|
21
21
|
s.platform = Gem::Platform::RUBY
|
|
22
|
-
s.authors = ["
|
|
22
|
+
s.authors = ["OpenAPI-Generator"]
|
|
23
23
|
s.email = ["support@phoenixnap.com"]
|
|
24
|
-
s.homepage = "https://
|
|
24
|
+
s.homepage = "https://openapi-generator.tech"
|
|
25
25
|
s.summary = "Billing API Ruby Gem"
|
|
26
|
-
s.description = "Billing API
|
|
26
|
+
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.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/phoenixnap-bare-metal-cloud-billing-models' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/billing/v1/)</b> "
|
|
27
27
|
s.license = "MPL-2.0"
|
|
28
28
|
s.required_ruby_version = ">= 2.7"
|
|
29
|
-
s.metadata = {
|
|
29
|
+
s.metadata = {}
|
|
30
30
|
|
|
31
31
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
|
32
32
|
|
|
@@ -36,4 +36,4 @@ Gem::Specification.new do |s|
|
|
|
36
36
|
s.test_files = `find spec/*`.split("\n")
|
|
37
37
|
s.executables = []
|
|
38
38
|
s.require_paths = ["lib"]
|
|
39
|
-
end
|
|
39
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -39,9 +39,9 @@ describe 'ProductAvailabilityApi' do
|
|
|
39
39
|
# @option opts [Array<String>] :product_category Product category. Currently only SERVER category is supported.
|
|
40
40
|
# @option opts [Array<String>] :product_code
|
|
41
41
|
# @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.
|
|
42
|
-
# @option opts [Array<
|
|
42
|
+
# @option opts [Array<ProductLocationEnum>] :location
|
|
43
43
|
# @option opts [Array<String>] :solution
|
|
44
|
-
# @option opts [Float] :min_quantity
|
|
44
|
+
# @option opts [Float] :min_quantity Minimum quantity of the product that can be requested. For servers the allowed quantity range is 1 to 10.
|
|
45
45
|
# @return [Array<ProductAvailability>]
|
|
46
46
|
describe 'product_availability_get test' do
|
|
47
47
|
it 'should work' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::ApplicableDiscountDetails do
|
|
21
|
-
let(:instance) { BillingApi::ApplicableDiscountDetails.new }
|
|
21
|
+
#let(:instance) { BillingApi::ApplicableDiscountDetails.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of ApplicableDiscountDetails' do
|
|
24
24
|
it 'should create an instance of ApplicableDiscountDetails' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::ApplicableDiscounts do
|
|
21
|
-
let(:instance) { BillingApi::ApplicableDiscounts.new }
|
|
21
|
+
#let(:instance) { BillingApi::ApplicableDiscounts.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of ApplicableDiscounts' do
|
|
24
24
|
it 'should create an instance of ApplicableDiscounts' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::BandwidthDetails do
|
|
21
|
-
let(:instance) { BillingApi::BandwidthDetails.new }
|
|
21
|
+
#let(:instance) { BillingApi::BandwidthDetails.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of BandwidthDetails' do
|
|
24
24
|
it 'should create an instance of BandwidthDetails' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::BandwidthRecord do
|
|
21
|
-
let(:instance) { BillingApi::BandwidthRecord.new }
|
|
21
|
+
#let(:instance) { BillingApi::BandwidthRecord.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of BandwidthRecord' do
|
|
24
24
|
it 'should create an instance of BandwidthRecord' do
|
|
@@ -135,6 +135,12 @@ describe BillingApi::BandwidthRecord do
|
|
|
135
135
|
end
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
describe 'test attribute "reservation_details"' do
|
|
139
|
+
it 'should work' do
|
|
140
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
138
144
|
describe 'test attribute "discount_details"' do
|
|
139
145
|
it 'should work' do
|
|
140
146
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::ConfigurationDetails do
|
|
21
|
-
let(:instance) { BillingApi::ConfigurationDetails.new }
|
|
21
|
+
#let(:instance) { BillingApi::ConfigurationDetails.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of ConfigurationDetails' do
|
|
24
24
|
it 'should create an instance of ConfigurationDetails' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::CreditDetailsBase do
|
|
21
|
-
let(:instance) { BillingApi::CreditDetailsBase.new }
|
|
21
|
+
#let(:instance) { BillingApi::CreditDetailsBase.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of CreditDetailsBase' do
|
|
24
24
|
it 'should create an instance of CreditDetailsBase' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::CreditTypeEnum do
|
|
21
|
-
let(:instance) { BillingApi::CreditTypeEnum.new }
|
|
21
|
+
#let(:instance) { BillingApi::CreditTypeEnum.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of CreditTypeEnum' do
|
|
24
24
|
it 'should create an instance of CreditTypeEnum' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::DiscountDetails do
|
|
21
|
-
let(:instance) { BillingApi::DiscountDetails.new }
|
|
21
|
+
#let(:instance) { BillingApi::DiscountDetails.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of DiscountDetails' do
|
|
24
24
|
it 'should create an instance of DiscountDetails' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::DiscountTypeEnum do
|
|
21
|
-
let(:instance) { BillingApi::DiscountTypeEnum.new }
|
|
21
|
+
#let(:instance) { BillingApi::DiscountTypeEnum.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of DiscountTypeEnum' do
|
|
24
24
|
it 'should create an instance of DiscountTypeEnum' do
|
data/spec/models/error_spec.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::Error do
|
|
21
|
-
let(:instance) { BillingApi::Error.new }
|
|
21
|
+
#let(:instance) { BillingApi::Error.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of Error' do
|
|
24
24
|
it 'should create an instance of Error' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::GpuConfigurationMetadata do
|
|
21
|
-
let(:instance) { BillingApi::GpuConfigurationMetadata.new }
|
|
21
|
+
#let(:instance) { BillingApi::GpuConfigurationMetadata.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of GpuConfigurationMetadata' do
|
|
24
24
|
it 'should create an instance of GpuConfigurationMetadata' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::LocationAvailabilityDetail do
|
|
21
|
-
let(:instance) { BillingApi::LocationAvailabilityDetail.new }
|
|
21
|
+
#let(:instance) { BillingApi::LocationAvailabilityDetail.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of LocationAvailabilityDetail' do
|
|
24
24
|
it 'should create an instance of LocationAvailabilityDetail' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::LocationEnum do
|
|
21
|
-
let(:instance) { BillingApi::LocationEnum.new }
|
|
21
|
+
#let(:instance) { BillingApi::LocationEnum.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of LocationEnum' do
|
|
24
24
|
it 'should create an instance of LocationEnum' do
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe BillingApi::OperatingSystemDetails do
|
|
21
|
-
let(:instance) { BillingApi::OperatingSystemDetails.new }
|
|
21
|
+
#let(:instance) { BillingApi::OperatingSystemDetails.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of OperatingSystemDetails' do
|
|
24
24
|
it 'should create an instance of OperatingSystemDetails' do
|