pnap_billing_api 1.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 +7 -0
- data/Gemfile +9 -0
- data/README.md +187 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/ApplicableDiscounts.md +20 -0
- data/docs/BandwidthDetails.md +24 -0
- data/docs/BandwidthRecord.md +56 -0
- data/docs/BillingConfigurationsApi.md +74 -0
- data/docs/ConfigurationDetails.md +18 -0
- data/docs/DiscountDetails.md +22 -0
- data/docs/Error.md +20 -0
- data/docs/LocationAvailabilityDetail.md +26 -0
- data/docs/LocationEnum.md +15 -0
- data/docs/OperatingSystemDetails.md +20 -0
- data/docs/OperatingSystemRecord.md +56 -0
- data/docs/PriceUnitEnum.md +15 -0
- data/docs/PricingPlan.md +36 -0
- data/docs/Product.md +22 -0
- data/docs/ProductAvailability.md +22 -0
- data/docs/ProductCategoryEnum.md +15 -0
- data/docs/ProductsApi.md +167 -0
- data/docs/ProductsGet200ResponseInner.md +82 -0
- data/docs/PublicSubnetDetails.md +22 -0
- data/docs/PublicSubnetRecord.md +56 -0
- data/docs/RatedUsageApi.md +155 -0
- data/docs/RatedUsageGet200ResponseInner.md +88 -0
- data/docs/RatedUsageRecord.md +54 -0
- data/docs/Reservation.md +48 -0
- data/docs/ReservationAutoRenewDisableRequest.md +18 -0
- data/docs/ReservationInvoicingModelEnum.md +15 -0
- data/docs/ReservationModelEnum.md +15 -0
- data/docs/ReservationRequest.md +18 -0
- data/docs/ReservationsApi.md +439 -0
- data/docs/ServerDetails.md +20 -0
- data/docs/ServerProduct.md +24 -0
- data/docs/ServerProductMetadata.md +30 -0
- data/docs/ServerRecord.md +56 -0
- data/docs/StorageDetails.md +28 -0
- data/docs/StorageRecord.md +56 -0
- data/docs/ThresholdConfigurationDetails.md +18 -0
- data/lib/pnap_billing_api/api/billing_configurations_api.rb +79 -0
- data/lib/pnap_billing_api/api/products_api.rb +174 -0
- data/lib/pnap_billing_api/api/rated_usage_api.rb +156 -0
- data/lib/pnap_billing_api/api/reservations_api.rb +412 -0
- data/lib/pnap_billing_api/api_client.rb +397 -0
- data/lib/pnap_billing_api/api_error.rb +58 -0
- data/lib/pnap_billing_api/configuration.rb +298 -0
- data/lib/pnap_billing_api/models/applicable_discounts.rb +227 -0
- data/lib/pnap_billing_api/models/bandwidth_details.rb +294 -0
- data/lib/pnap_billing_api/models/bandwidth_record.rb +548 -0
- data/lib/pnap_billing_api/models/configuration_details.rb +215 -0
- data/lib/pnap_billing_api/models/discount_details.rb +291 -0
- data/lib/pnap_billing_api/models/error.rb +234 -0
- data/lib/pnap_billing_api/models/location_availability_detail.rb +314 -0
- data/lib/pnap_billing_api/models/location_enum.rb +45 -0
- data/lib/pnap_billing_api/models/operating_system_details.rb +240 -0
- data/lib/pnap_billing_api/models/operating_system_record.rb +548 -0
- data/lib/pnap_billing_api/models/price_unit_enum.rb +44 -0
- data/lib/pnap_billing_api/models/pricing_plan.rb +397 -0
- data/lib/pnap_billing_api/models/product.rb +252 -0
- data/lib/pnap_billing_api/models/product_availability.rb +258 -0
- data/lib/pnap_billing_api/models/product_category_enum.rb +43 -0
- data/lib/pnap_billing_api/models/products_get200_response_inner.rb +61 -0
- data/lib/pnap_billing_api/models/public_subnet_details.rb +250 -0
- data/lib/pnap_billing_api/models/public_subnet_record.rb +548 -0
- data/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb +64 -0
- data/lib/pnap_billing_api/models/rated_usage_record.rb +526 -0
- data/lib/pnap_billing_api/models/reservation.rb +466 -0
- data/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb +215 -0
- data/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb +40 -0
- data/lib/pnap_billing_api/models/reservation_model_enum.rb +43 -0
- data/lib/pnap_billing_api/models/reservation_request.rb +223 -0
- data/lib/pnap_billing_api/models/server_details.rb +240 -0
- data/lib/pnap_billing_api/models/server_product.rb +274 -0
- data/lib/pnap_billing_api/models/server_product_metadata.rb +325 -0
- data/lib/pnap_billing_api/models/server_record.rb +548 -0
- data/lib/pnap_billing_api/models/storage_details.rb +308 -0
- data/lib/pnap_billing_api/models/storage_record.rb +548 -0
- data/lib/pnap_billing_api/models/threshold_configuration_details.rb +223 -0
- data/lib/pnap_billing_api/version.rb +19 -0
- data/lib/pnap_billing_api.rb +75 -0
- data/pnap_billing_api.gemspec +39 -0
- data/spec/api/billing_configurations_api_spec.rb +46 -0
- data/spec/api/products_api_spec.rb +67 -0
- data/spec/api/rated_usage_api_spec.rb +61 -0
- data/spec/api/reservations_api_spec.rb +109 -0
- data/spec/models/applicable_discounts_spec.rb +42 -0
- data/spec/models/bandwidth_details_spec.rb +58 -0
- data/spec/models/bandwidth_record_spec.rb +154 -0
- data/spec/models/configuration_details_spec.rb +36 -0
- data/spec/models/discount_details_spec.rb +52 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/location_availability_detail_spec.rb +64 -0
- data/spec/models/location_enum_spec.rb +30 -0
- data/spec/models/operating_system_details_spec.rb +42 -0
- data/spec/models/operating_system_record_spec.rb +154 -0
- data/spec/models/price_unit_enum_spec.rb +30 -0
- data/spec/models/pricing_plan_spec.rb +102 -0
- data/spec/models/product_availability_spec.rb +48 -0
- data/spec/models/product_category_enum_spec.rb +30 -0
- data/spec/models/product_spec.rb +48 -0
- data/spec/models/products_get200_response_inner_spec.rb +44 -0
- data/spec/models/public_subnet_details_spec.rb +48 -0
- data/spec/models/public_subnet_record_spec.rb +154 -0
- data/spec/models/rated_usage_get200_response_inner_spec.rb +44 -0
- data/spec/models/rated_usage_record_spec.rb +148 -0
- data/spec/models/reservation_auto_renew_disable_request_spec.rb +36 -0
- data/spec/models/reservation_invoicing_model_enum_spec.rb +30 -0
- data/spec/models/reservation_model_enum_spec.rb +30 -0
- data/spec/models/reservation_request_spec.rb +36 -0
- data/spec/models/reservation_spec.rb +130 -0
- data/spec/models/server_details_spec.rb +42 -0
- data/spec/models/server_product_metadata_spec.rb +72 -0
- data/spec/models/server_product_spec.rb +54 -0
- data/spec/models/server_record_spec.rb +154 -0
- data/spec/models/storage_details_spec.rb +66 -0
- data/spec/models/storage_record_spec.rb +154 -0
- data/spec/models/threshold_configuration_details_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +240 -0
@@ -0,0 +1,223 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module BillingApi
|
17
|
+
# Threshold billing configuration.
|
18
|
+
class ThresholdConfigurationDetails
|
19
|
+
# Threshold billing amount.
|
20
|
+
attr_accessor :threshold_amount
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'threshold_amount' => :'thresholdAmount'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
:'threshold_amount' => :'Float'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of attributes with nullable: true
|
42
|
+
def self.openapi_nullable
|
43
|
+
Set.new([
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BillingApi::ThresholdConfigurationDetails` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
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
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'threshold_amount')
|
63
|
+
self.threshold_amount = attributes[:'threshold_amount']
|
64
|
+
else
|
65
|
+
self.threshold_amount = nil
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
73
|
+
invalid_properties = Array.new
|
74
|
+
if @threshold_amount.nil?
|
75
|
+
invalid_properties.push('invalid value for "threshold_amount", threshold_amount cannot be nil.')
|
76
|
+
end
|
77
|
+
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
|
+
return false if @threshold_amount.nil?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
threshold_amount == o.threshold_amount
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[threshold_amount].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
|
+
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
new(transformed_hash)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def self._deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = BillingApi.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
@@ -0,0 +1,19 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
def get_version()
|
14
|
+
return File.read(File.expand_path('../../../VERSION', __FILE__)).strip
|
15
|
+
end
|
16
|
+
|
17
|
+
module BillingApi
|
18
|
+
VERSION = get_version()
|
19
|
+
end
|
@@ -0,0 +1,75 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'pnap_billing_api/api_client'
|
15
|
+
require 'pnap_billing_api/api_error'
|
16
|
+
require 'pnap_billing_api/version'
|
17
|
+
require 'pnap_billing_api/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'pnap_billing_api/models/applicable_discounts'
|
21
|
+
require 'pnap_billing_api/models/bandwidth_details'
|
22
|
+
require 'pnap_billing_api/models/bandwidth_record'
|
23
|
+
require 'pnap_billing_api/models/configuration_details'
|
24
|
+
require 'pnap_billing_api/models/discount_details'
|
25
|
+
require 'pnap_billing_api/models/error'
|
26
|
+
require 'pnap_billing_api/models/location_availability_detail'
|
27
|
+
require 'pnap_billing_api/models/location_enum'
|
28
|
+
require 'pnap_billing_api/models/operating_system_details'
|
29
|
+
require 'pnap_billing_api/models/operating_system_record'
|
30
|
+
require 'pnap_billing_api/models/price_unit_enum'
|
31
|
+
require 'pnap_billing_api/models/pricing_plan'
|
32
|
+
require 'pnap_billing_api/models/product'
|
33
|
+
require 'pnap_billing_api/models/product_availability'
|
34
|
+
require 'pnap_billing_api/models/product_category_enum'
|
35
|
+
require 'pnap_billing_api/models/products_get200_response_inner'
|
36
|
+
require 'pnap_billing_api/models/public_subnet_details'
|
37
|
+
require 'pnap_billing_api/models/public_subnet_record'
|
38
|
+
require 'pnap_billing_api/models/rated_usage_get200_response_inner'
|
39
|
+
require 'pnap_billing_api/models/rated_usage_record'
|
40
|
+
require 'pnap_billing_api/models/reservation'
|
41
|
+
require 'pnap_billing_api/models/reservation_auto_renew_disable_request'
|
42
|
+
require 'pnap_billing_api/models/reservation_invoicing_model_enum'
|
43
|
+
require 'pnap_billing_api/models/reservation_model_enum'
|
44
|
+
require 'pnap_billing_api/models/reservation_request'
|
45
|
+
require 'pnap_billing_api/models/server_details'
|
46
|
+
require 'pnap_billing_api/models/server_product'
|
47
|
+
require 'pnap_billing_api/models/server_product_metadata'
|
48
|
+
require 'pnap_billing_api/models/server_record'
|
49
|
+
require 'pnap_billing_api/models/storage_details'
|
50
|
+
require 'pnap_billing_api/models/storage_record'
|
51
|
+
require 'pnap_billing_api/models/threshold_configuration_details'
|
52
|
+
|
53
|
+
# APIs
|
54
|
+
require 'pnap_billing_api/api/billing_configurations_api'
|
55
|
+
require 'pnap_billing_api/api/products_api'
|
56
|
+
require 'pnap_billing_api/api/rated_usage_api'
|
57
|
+
require 'pnap_billing_api/api/reservations_api'
|
58
|
+
|
59
|
+
module BillingApi
|
60
|
+
class << self
|
61
|
+
# Customize default settings for the SDK using block.
|
62
|
+
# BillingApi.configure do |config|
|
63
|
+
# config.username = "xxx"
|
64
|
+
# config.password = "xxx"
|
65
|
+
# end
|
66
|
+
# If no block given, return the default Configuration object.
|
67
|
+
def configure
|
68
|
+
if block_given?
|
69
|
+
yield(Configuration.default)
|
70
|
+
else
|
71
|
+
Configuration.default
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Billing API
|
5
|
+
|
6
|
+
#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>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1
|
9
|
+
Contact: support@phoenixnap.com
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 7.2.0
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "pnap_billing_api/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "pnap_billing_api"
|
20
|
+
s.version = BillingApi::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["PhoenixNAP"]
|
23
|
+
s.email = ["support@phoenixnap.com"]
|
24
|
+
s.homepage = "https://phoenixnap.com/bare-metal-cloud"
|
25
|
+
s.summary = "Billing API Ruby Gem"
|
26
|
+
s.description = "Billing API Ruby Gem"
|
27
|
+
s.license = "MPL-2.0"
|
28
|
+
s.required_ruby_version = ">= 2.7"
|
29
|
+
s.metadata = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
|
30
|
+
|
31
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
|
35
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
36
|
+
s.test_files = `find spec/*`.split("\n")
|
37
|
+
s.executables = []
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
end
|
@@ -0,0 +1,46 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for BillingApi::BillingConfigurationsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'BillingConfigurationsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = BillingApi::BillingConfigurationsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of BillingConfigurationsApi' do
|
30
|
+
it 'should create an instance of BillingConfigurationsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(BillingApi::BillingConfigurationsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for account_billing_configuration_me_get
|
36
|
+
# Retrieves billing configuration associated with the authenticated account.
|
37
|
+
# Retrieves billing configuration associated with the authenticated account.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @return [ConfigurationDetails]
|
40
|
+
describe 'account_billing_configuration_me_get test' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,67 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for BillingApi::ProductsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ProductsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = BillingApi::ProductsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ProductsApi' do
|
30
|
+
it 'should create an instance of ProductsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(BillingApi::ProductsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for product_availability_get
|
36
|
+
# List all Product availabilities.
|
37
|
+
# Retrieves the list of product availability details.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [Array<String>] :product_category Product category. Currently only SERVER category is supported.
|
40
|
+
# @option opts [Array<String>] :product_code
|
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<LocationEnum>] :location
|
43
|
+
# @option opts [Array<String>] :solution
|
44
|
+
# @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.
|
45
|
+
# @return [Array<ProductAvailability>]
|
46
|
+
describe 'product_availability_get test' do
|
47
|
+
it 'should work' do
|
48
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# unit tests for products_get
|
53
|
+
# List all Products.
|
54
|
+
# Retrieves all Products.
|
55
|
+
# @param [Hash] opts the optional parameters
|
56
|
+
# @option opts [String] :product_code
|
57
|
+
# @option opts [String] :product_category
|
58
|
+
# @option opts [String] :sku_code
|
59
|
+
# @option opts [String] :location
|
60
|
+
# @return [Array<ProductsGet200ResponseInner>]
|
61
|
+
describe 'products_get test' do
|
62
|
+
it 'should work' do
|
63
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,61 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for BillingApi::RatedUsageApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'RatedUsageApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = BillingApi::RatedUsageApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of RatedUsageApi' do
|
30
|
+
it 'should create an instance of RatedUsageApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(BillingApi::RatedUsageApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for rated_usage_get
|
36
|
+
# List the rated usage.
|
37
|
+
# Retrieves all rated usage for given time period. The information is presented as a list of rated usage records. Every record corresponds to a charge. All date & times are in UTC.
|
38
|
+
# @param from_year_month From year month (inclusive) to filter rated usage records by.
|
39
|
+
# @param to_year_month To year month (inclusive) to filter rated usage records by.
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @option opts [ProductCategoryEnum] :product_category The product category
|
42
|
+
# @return [Array<RatedUsageGet200ResponseInner>]
|
43
|
+
describe 'rated_usage_get test' do
|
44
|
+
it 'should work' do
|
45
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# unit tests for rated_usage_month_to_date_get
|
50
|
+
# List the rated usage records for the current calendar month.
|
51
|
+
# Retrieves all rated usage for the current calendar month. The information is presented as a list of rated usage records. Every record corresponds to a charge. All date & times are in UTC.
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @option opts [ProductCategoryEnum] :product_category The product category
|
54
|
+
# @return [Array<RatedUsageGet200ResponseInner>]
|
55
|
+
describe 'rated_usage_month_to_date_get test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,109 @@
|
|
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
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for BillingApi::ReservationsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ReservationsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = BillingApi::ReservationsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ReservationsApi' do
|
30
|
+
it 'should create an instance of ReservationsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(BillingApi::ReservationsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for reservations_get
|
36
|
+
# List all Reservations.
|
37
|
+
# Retrieves all reservations associated with the authenticated account. All date & times are in UTC.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [ProductCategoryEnum] :product_category The product category
|
40
|
+
# @return [Array<Reservation>]
|
41
|
+
describe 'reservations_get test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for reservations_post
|
48
|
+
# Create a reservation.
|
49
|
+
# Creates new package reservation for authenticated account.
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [ReservationRequest] :reservation_request
|
52
|
+
# @return [Reservation]
|
53
|
+
describe 'reservations_post test' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for reservations_reservation_id_actions_auto_renew_disable_post
|
60
|
+
# Disable auto-renewal for reservation by id.
|
61
|
+
# Disable auto-renewal for reservation by reservation id.
|
62
|
+
# @param reservation_id The reservation's ID.
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @option opts [ReservationAutoRenewDisableRequest] :reservation_auto_renew_disable_request
|
65
|
+
# @return [Reservation]
|
66
|
+
describe 'reservations_reservation_id_actions_auto_renew_disable_post test' do
|
67
|
+
it 'should work' do
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for reservations_reservation_id_actions_auto_renew_enable_post
|
73
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
74
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
75
|
+
# @param reservation_id The reservation's ID.
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @return [Reservation]
|
78
|
+
describe 'reservations_reservation_id_actions_auto_renew_enable_post test' do
|
79
|
+
it 'should work' do
|
80
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# unit tests for reservations_reservation_id_actions_convert_post
|
85
|
+
# Convert reservation pricing model by reservation ID.
|
86
|
+
# Convert reservation pricing model by reservation id.
|
87
|
+
# @param reservation_id The reservation's ID.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @option opts [ReservationRequest] :reservation_request
|
90
|
+
# @return [Reservation]
|
91
|
+
describe 'reservations_reservation_id_actions_convert_post test' do
|
92
|
+
it 'should work' do
|
93
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# unit tests for reservations_reservation_id_get
|
98
|
+
# Get a reservation.
|
99
|
+
# Retrieves the reservations with the specified identifier. All date & times are in UTC.
|
100
|
+
# @param reservation_id The reservation's ID.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [Reservation]
|
103
|
+
describe 'reservations_reservation_id_get test' do
|
104
|
+
it 'should work' do
|
105
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|