togai_client 1.0.0 → 1.0.1
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 +1 -1
- data/docs/AccountsApi.md +1 -1
- data/docs/AssociatePricePlanRequest.md +4 -4
- data/docs/Bundle.md +22 -0
- data/docs/CreatePricePlanRequest.md +2 -4
- data/docs/EventPipelineInfoPricePlansInner.md +2 -0
- data/docs/EventSchemaListData.md +2 -2
- data/docs/EventSchemaListDataAllOf.md +2 -2
- data/docs/GetEventResponse.md +1 -1
- data/docs/PlanOverride.md +2 -2
- data/docs/PricePlan.md +0 -2
- data/docs/PricePlanDetails.md +20 -0
- data/docs/PricePlanDetailsOverride.md +20 -0
- data/docs/PricePlanListData.md +2 -4
- data/docs/PricePlanPaginatedResponse.md +1 -1
- data/docs/PricePlansApi.md +1 -1
- data/docs/PriceType.md +15 -0
- data/docs/{PricingCycle.md → PricingCycleConfig.md} +3 -3
- data/docs/{PricingCycleStartOffset.md → PricingCycleConfigStartOffset.md} +2 -2
- data/docs/PricingModel.md +15 -0
- data/docs/PricingSchedule.md +2 -2
- data/docs/RateCard.md +6 -6
- data/docs/RateCardBundleAggregation.md +15 -0
- data/docs/RateCardType.md +15 -0
- data/docs/RateConfigBundle.md +20 -0
- data/docs/RateConfigUsage.md +20 -0
- data/docs/SlabBundle.md +24 -0
- data/docs/{UsageStrategy.md → SlabUsage.md} +6 -2
- data/docs/UpdatePricePlanRequest.md +2 -4
- data/examples/example.rb +222 -0
- data/lib/togai_client/models/associate_price_plan_request.rb +17 -7
- data/lib/togai_client/models/{bundle_strategy.rb → bundle.rb} +34 -85
- data/lib/togai_client/models/create_customer_request.rb +0 -9
- data/lib/togai_client/models/create_customer_response.rb +0 -9
- data/lib/togai_client/models/create_price_plan_request.rb +10 -24
- data/lib/togai_client/models/customer.rb +0 -9
- data/lib/togai_client/models/event_pipeline_info_price_plans_inner.rb +15 -1
- data/lib/togai_client/models/event_schema_list_data.rb +7 -9
- data/lib/togai_client/models/event_schema_list_data_all_of.rb +7 -9
- data/lib/togai_client/models/get_event_response.rb +5 -0
- data/lib/togai_client/models/ingestion_status.rb +2 -2
- data/lib/togai_client/models/plan_override.rb +7 -7
- data/lib/togai_client/models/price_plan.rb +1 -15
- data/lib/togai_client/models/price_plan_details.rb +259 -0
- data/lib/togai_client/models/price_plan_details_override.rb +245 -0
- data/lib/togai_client/models/price_plan_list_data.rb +10 -25
- data/lib/togai_client/models/price_plan_paginated_response.rb +5 -0
- data/lib/togai_client/models/price_type.rb +38 -0
- data/lib/togai_client/models/{pricing_cycle.rb → pricing_cycle_config.rb} +4 -4
- data/lib/togai_client/models/{pricing_cycle_start_offset.rb → pricing_cycle_config_start_offset.rb} +3 -3
- data/lib/togai_client/models/pricing_model.rb +37 -0
- data/lib/togai_client/models/pricing_schedule.rb +7 -7
- data/lib/togai_client/models/rate_card.rb +32 -59
- data/lib/togai_client/models/rate_card_bundle_aggregation.rb +39 -0
- data/lib/togai_client/models/rate_card_type.rb +37 -0
- data/lib/togai_client/models/{bundle_strategy_usage_meters_value.rb → rate_config_bundle.rb} +28 -13
- data/lib/togai_client/models/{rate_card_usage_value.rb → rate_config_usage.rb} +15 -98
- data/lib/togai_client/models/signup_request.rb +0 -11
- data/lib/togai_client/models/slab_bundle.rb +264 -0
- data/lib/togai_client/models/{usage_strategy.rb → slab_usage.rb} +30 -5
- data/lib/togai_client/models/update_customer_request.rb +0 -9
- data/lib/togai_client/models/update_price_plan_request.rb +7 -16
- data/lib/togai_client/models/user_details.rb +0 -11
- data/lib/togai_client/version.rb +1 -1
- data/lib/togai_client.rb +13 -7
- metadata +36 -23
- data/docs/BundleStrategy.md +0 -24
- data/docs/BundleStrategyUsageMetersValue.md +0 -18
- data/docs/RateCardBundle.md +0 -22
- data/docs/RateCardUsageValue.md +0 -24
- data/lib/togai_client/models/rate_card_bundle.rb +0 -328
@@ -0,0 +1,245 @@
|
|
1
|
+
=begin
|
2
|
+
#Togai Apis
|
3
|
+
|
4
|
+
#APIs for Togai App
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: engg@togai.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TogaiClient
|
17
|
+
class PricePlanDetailsOverride
|
18
|
+
attr_accessor :pricing_cycle_config
|
19
|
+
|
20
|
+
attr_accessor :rate_cards
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'pricing_cycle_config' => :'pricingCycleConfig',
|
26
|
+
:'rate_cards' => :'rateCards'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'pricing_cycle_config' => :'PricingCycleConfig',
|
39
|
+
:'rate_cards' => :'Array<RateCard>'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::PricePlanDetailsOverride` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::PricePlanDetailsOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'pricing_cycle_config')
|
65
|
+
self.pricing_cycle_config = attributes[:'pricing_cycle_config']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'rate_cards')
|
69
|
+
if (value = attributes[:'rate_cards']).is_a?(Array)
|
70
|
+
self.rate_cards = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if !@rate_cards.nil? && @rate_cards.length < 1
|
80
|
+
invalid_properties.push('invalid value for "rate_cards", number of items must be greater than or equal to 1.')
|
81
|
+
end
|
82
|
+
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if !@rate_cards.nil? && @rate_cards.length < 1
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Custom attribute writer method with validation
|
94
|
+
# @param [Object] rate_cards Value to be assigned
|
95
|
+
def rate_cards=(rate_cards)
|
96
|
+
if !rate_cards.nil? && rate_cards.length < 1
|
97
|
+
fail ArgumentError, 'invalid value for "rate_cards", number of items must be greater than or equal to 1.'
|
98
|
+
end
|
99
|
+
|
100
|
+
@rate_cards = rate_cards
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
pricing_cycle_config == o.pricing_cycle_config &&
|
109
|
+
rate_cards == o.rate_cards
|
110
|
+
end
|
111
|
+
|
112
|
+
# @see the `==` method
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def eql?(o)
|
115
|
+
self == o
|
116
|
+
end
|
117
|
+
|
118
|
+
# Calculates hash code according to all attributes.
|
119
|
+
# @return [Integer] Hash code
|
120
|
+
def hash
|
121
|
+
[pricing_cycle_config, rate_cards].hash
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def self.build_from_hash(attributes)
|
128
|
+
new.build_from_hash(attributes)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def build_from_hash(attributes)
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
136
|
+
attributes = attributes.transform_keys(&:to_sym)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
139
|
+
self.send("#{key}=", nil)
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = TogaiClient.const_get(type)
|
193
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
@@ -25,13 +25,10 @@ module TogaiClient
|
|
25
25
|
# Status of Price plan
|
26
26
|
attr_accessor :status
|
27
27
|
|
28
|
-
attr_accessor :pricing_cycle
|
29
|
-
|
30
28
|
# Usage meters name linked to the price plan
|
31
29
|
attr_accessor :usage_meters
|
32
30
|
|
33
|
-
|
34
|
-
attr_accessor :pricing_type
|
31
|
+
attr_accessor :price_plan_details
|
35
32
|
|
36
33
|
attr_accessor :created_at
|
37
34
|
|
@@ -65,9 +62,8 @@ module TogaiClient
|
|
65
62
|
:'name' => :'name',
|
66
63
|
:'description' => :'description',
|
67
64
|
:'status' => :'status',
|
68
|
-
:'pricing_cycle' => :'pricingCycle',
|
69
65
|
:'usage_meters' => :'usageMeters',
|
70
|
-
:'
|
66
|
+
:'price_plan_details' => :'pricePlanDetails',
|
71
67
|
:'created_at' => :'createdAt',
|
72
68
|
:'updated_at' => :'updatedAt'
|
73
69
|
}
|
@@ -84,9 +80,8 @@ module TogaiClient
|
|
84
80
|
:'name' => :'String',
|
85
81
|
:'description' => :'String',
|
86
82
|
:'status' => :'String',
|
87
|
-
:'pricing_cycle' => :'PricingCycle',
|
88
83
|
:'usage_meters' => :'Array<String>',
|
89
|
-
:'
|
84
|
+
:'price_plan_details' => :'PricePlanDetails',
|
90
85
|
:'created_at' => :'Time',
|
91
86
|
:'updated_at' => :'Time'
|
92
87
|
}
|
@@ -125,18 +120,14 @@ module TogaiClient
|
|
125
120
|
self.status = attributes[:'status']
|
126
121
|
end
|
127
122
|
|
128
|
-
if attributes.key?(:'pricing_cycle')
|
129
|
-
self.pricing_cycle = attributes[:'pricing_cycle']
|
130
|
-
end
|
131
|
-
|
132
123
|
if attributes.key?(:'usage_meters')
|
133
124
|
if (value = attributes[:'usage_meters']).is_a?(Array)
|
134
125
|
self.usage_meters = value
|
135
126
|
end
|
136
127
|
end
|
137
128
|
|
138
|
-
if attributes.key?(:'
|
139
|
-
self.
|
129
|
+
if attributes.key?(:'price_plan_details')
|
130
|
+
self.price_plan_details = attributes[:'price_plan_details']
|
140
131
|
end
|
141
132
|
|
142
133
|
if attributes.key?(:'created_at')
|
@@ -168,16 +159,12 @@ module TogaiClient
|
|
168
159
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
169
160
|
end
|
170
161
|
|
171
|
-
if @pricing_cycle.nil?
|
172
|
-
invalid_properties.push('invalid value for "pricing_cycle", pricing_cycle cannot be nil.')
|
173
|
-
end
|
174
|
-
|
175
162
|
if @usage_meters.nil?
|
176
163
|
invalid_properties.push('invalid value for "usage_meters", usage_meters cannot be nil.')
|
177
164
|
end
|
178
165
|
|
179
|
-
if @
|
180
|
-
invalid_properties.push('invalid value for "
|
166
|
+
if @price_plan_details.nil?
|
167
|
+
invalid_properties.push('invalid value for "price_plan_details", price_plan_details cannot be nil.')
|
181
168
|
end
|
182
169
|
|
183
170
|
if @created_at.nil?
|
@@ -200,9 +187,8 @@ module TogaiClient
|
|
200
187
|
return false if @status.nil?
|
201
188
|
status_validator = EnumAttributeValidator.new('String', ["DRAFT", "ACTIVE", "ARCHIVED"])
|
202
189
|
return false unless status_validator.valid?(@status)
|
203
|
-
return false if @pricing_cycle.nil?
|
204
190
|
return false if @usage_meters.nil?
|
205
|
-
return false if @
|
191
|
+
return false if @price_plan_details.nil?
|
206
192
|
return false if @created_at.nil?
|
207
193
|
return false if @updated_at.nil?
|
208
194
|
true
|
@@ -250,9 +236,8 @@ module TogaiClient
|
|
250
236
|
name == o.name &&
|
251
237
|
description == o.description &&
|
252
238
|
status == o.status &&
|
253
|
-
pricing_cycle == o.pricing_cycle &&
|
254
239
|
usage_meters == o.usage_meters &&
|
255
|
-
|
240
|
+
price_plan_details == o.price_plan_details &&
|
256
241
|
created_at == o.created_at &&
|
257
242
|
updated_at == o.updated_at
|
258
243
|
end
|
@@ -266,7 +251,7 @@ module TogaiClient
|
|
266
251
|
# Calculates hash code according to all attributes.
|
267
252
|
# @return [Integer] Hash code
|
268
253
|
def hash
|
269
|
-
[name, description, status,
|
254
|
+
[name, description, status, usage_meters, price_plan_details, created_at, updated_at].hash
|
270
255
|
end
|
271
256
|
|
272
257
|
# Builds the object from hash
|
@@ -84,12 +84,17 @@ module TogaiClient
|
|
84
84
|
# @return Array for valid properties with the reasons
|
85
85
|
def list_invalid_properties
|
86
86
|
invalid_properties = Array.new
|
87
|
+
if @data.nil?
|
88
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
89
|
+
end
|
90
|
+
|
87
91
|
invalid_properties
|
88
92
|
end
|
89
93
|
|
90
94
|
# Check to see if the all the properties in the model are valid
|
91
95
|
# @return true if the model is valid
|
92
96
|
def valid?
|
97
|
+
return false if @data.nil?
|
93
98
|
true
|
94
99
|
end
|
95
100
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
=begin
|
2
|
+
#Togai Apis
|
3
|
+
|
4
|
+
#APIs for Togai App
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: engg@togai.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TogaiClient
|
17
|
+
class PriceType
|
18
|
+
FLAT = "FLAT".freeze
|
19
|
+
PER_UNIT = "PER_UNIT".freeze
|
20
|
+
PACKAGE = "PACKAGE".freeze
|
21
|
+
|
22
|
+
# Builds the enum from string
|
23
|
+
# @param [String] The enum value in the form of the string
|
24
|
+
# @return [String] The enum value
|
25
|
+
def self.build_from_hash(value)
|
26
|
+
new.build_from_hash(value)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Builds the enum from string
|
30
|
+
# @param [String] The enum value in the form of the string
|
31
|
+
# @return [String] The enum value
|
32
|
+
def build_from_hash(value)
|
33
|
+
constantValues = PriceType.constants.select { |c| PriceType::const_get(c) == value }
|
34
|
+
raise "Invalid ENUM value #{value} for class #PriceType" if constantValues.empty?
|
35
|
+
value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module TogaiClient
|
17
17
|
# Represents configurations related to pricing cycle
|
18
|
-
class
|
18
|
+
class PricingCycleConfig
|
19
19
|
attr_accessor :interval
|
20
20
|
|
21
21
|
attr_accessor :start_type
|
@@ -66,7 +66,7 @@ module TogaiClient
|
|
66
66
|
{
|
67
67
|
:'interval' => :'String',
|
68
68
|
:'start_type' => :'String',
|
69
|
-
:'start_offset' => :'
|
69
|
+
:'start_offset' => :'PricingCycleConfigStartOffset',
|
70
70
|
:'grace_period' => :'Integer'
|
71
71
|
}
|
72
72
|
end
|
@@ -81,13 +81,13 @@ module TogaiClient
|
|
81
81
|
# @param [Hash] attributes Model attributes in the form of hash
|
82
82
|
def initialize(attributes = {})
|
83
83
|
if (!attributes.is_a?(Hash))
|
84
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::PricingCycleConfig` initialize method"
|
85
85
|
end
|
86
86
|
|
87
87
|
# check to see if the attribute exists and convert string to symbol for hash key
|
88
88
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
89
89
|
if (!self.class.attribute_map.key?(k.to_sym))
|
90
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::PricingCycleConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
91
91
|
end
|
92
92
|
h[k.to_sym] = v
|
93
93
|
}
|
data/lib/togai_client/models/{pricing_cycle_start_offset.rb → pricing_cycle_config_start_offset.rb}
RENAMED
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module TogaiClient
|
17
17
|
# Represents the start of pricing cycle in terms of - dayOffset - number of days from beginning of month and - monthOffset - number of months from beginning of interval (quarter, half-year or year) Note: If a day with offset doesn't exist for a month, closest previous day is considered Examples: MONTHLY - - {dayOffset: 1, monthOffset: NIL} - First day of every month - {dayOffset: 12, monthOffset: NIL} - 12th of every month - {dayOffset: 28, monthOffset: NIL} - 28th of every month. i.e, 28th of Jan, 28th of Feb, ... - {dayOffset: 30, monthOffset: NIL} - 30th of every month. i.e, 28th of Jan, 28th of Feb, ... - {dayOffset: LAST, monthOffset: NIL} - Last day of every month. i.e, 31st of Jan, 28th of Feb, ... QUARTERLY - {dayOffset: 15, monthOffset: FIRST} - 15th Jan, 15th Apr, 15th Jul and 15th Oct - {dayOffset: 15, monthOffset: 2} - 15th Feb, 15th May, 15th Aug and 15th Nov - {dayOffset: 15, monthOffset: LAST} - 15th Mar, 15th Jun, 15th Sep and 15th Dec - {dayOffset: LAST, monthOffset: FIRST} - 31st Jan, 30th Apr, 30th Jul and 31th Oct HALF_YEARLY - {dayOffset: 15, monthOffset: FIRST} - 15th Jan and 15th Jul - {dayOffset: 15, monthOffset: 4} - 15th Apr and 15th Oct - {dayOffset: 15, monthOffset: LAST} - 15th Jun and 15th Dec ANNUALLY - {dayOffset: 15, monthOffset: FIRST} - 15th Jan - {dayOffset: 15, monthOffset: 1} - 15th Jan - {dayOffset: LAST, monthOffset: 2} - 29th Feb on Leap year, 28th otherwise - {dayOffset: 15, monthOffset: 8} - 15th Aug - {dayOffset: 15, monthOffset: LAST} - 15th Dec
|
18
|
-
class
|
18
|
+
class PricingCycleConfigStartOffset
|
19
19
|
# min: \"1\" and max: \"31\" as strings. Spl. string allowed: LAST
|
20
20
|
attr_accessor :day_offset
|
21
21
|
|
@@ -53,13 +53,13 @@ module TogaiClient
|
|
53
53
|
# @param [Hash] attributes Model attributes in the form of hash
|
54
54
|
def initialize(attributes = {})
|
55
55
|
if (!attributes.is_a?(Hash))
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::PricingCycleConfigStartOffset` initialize method"
|
57
57
|
end
|
58
58
|
|
59
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
60
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
61
|
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::PricingCycleConfigStartOffset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
63
|
end
|
64
64
|
h[k.to_sym] = v
|
65
65
|
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
=begin
|
2
|
+
#Togai Apis
|
3
|
+
|
4
|
+
#APIs for Togai App
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: engg@togai.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TogaiClient
|
17
|
+
class PricingModel
|
18
|
+
TIERED = "TIERED".freeze
|
19
|
+
VOLUME = "VOLUME".freeze
|
20
|
+
|
21
|
+
# Builds the enum from string
|
22
|
+
# @param [String] The enum value in the form of the string
|
23
|
+
# @return [String] The enum value
|
24
|
+
def self.build_from_hash(value)
|
25
|
+
new.build_from_hash(value)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def build_from_hash(value)
|
32
|
+
constantValues = PricingModel.constants.select { |c| PricingModel::const_get(c) == value }
|
33
|
+
raise "Invalid ENUM value #{value} for class #PricingModel" if constantValues.empty?
|
34
|
+
value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module TogaiClient
|
17
17
|
# Represents effectiveness period and config of a price plan. i.e, price plan bound by time.
|
18
18
|
class PricingSchedule
|
19
|
-
attr_accessor :
|
19
|
+
attr_accessor :price_plan_details
|
20
20
|
|
21
21
|
attr_accessor :start_date
|
22
22
|
|
@@ -25,7 +25,7 @@ module TogaiClient
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
26
|
def self.attribute_map
|
27
27
|
{
|
28
|
-
:'
|
28
|
+
:'price_plan_details' => :'pricePlanDetails',
|
29
29
|
:'start_date' => :'startDate',
|
30
30
|
:'end_date' => :'endDate'
|
31
31
|
}
|
@@ -39,7 +39,7 @@ module TogaiClient
|
|
39
39
|
# Attribute type mapping.
|
40
40
|
def self.openapi_types
|
41
41
|
{
|
42
|
-
:'
|
42
|
+
:'price_plan_details' => :'PricePlanDetails',
|
43
43
|
:'start_date' => :'Time',
|
44
44
|
:'end_date' => :'Time'
|
45
45
|
}
|
@@ -66,8 +66,8 @@ module TogaiClient
|
|
66
66
|
h[k.to_sym] = v
|
67
67
|
}
|
68
68
|
|
69
|
-
if attributes.key?(:'
|
70
|
-
self.
|
69
|
+
if attributes.key?(:'price_plan_details')
|
70
|
+
self.price_plan_details = attributes[:'price_plan_details']
|
71
71
|
end
|
72
72
|
|
73
73
|
if attributes.key?(:'start_date')
|
@@ -107,7 +107,7 @@ module TogaiClient
|
|
107
107
|
def ==(o)
|
108
108
|
return true if self.equal?(o)
|
109
109
|
self.class == o.class &&
|
110
|
-
|
110
|
+
price_plan_details == o.price_plan_details &&
|
111
111
|
start_date == o.start_date &&
|
112
112
|
end_date == o.end_date
|
113
113
|
end
|
@@ -121,7 +121,7 @@ module TogaiClient
|
|
121
121
|
# Calculates hash code according to all attributes.
|
122
122
|
# @return [Integer] Hash code
|
123
123
|
def hash
|
124
|
-
[
|
124
|
+
[price_plan_details, start_date, end_date].hash
|
125
125
|
end
|
126
126
|
|
127
127
|
# Builds the object from hash
|