late-sdk 0.0.782 → 0.0.783
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 +6 -0
- data/docs/UsageApi.md +8 -2
- data/docs/UsageAttributionGroup.md +22 -0
- data/docs/UsageAttributionSlice.md +20 -0
- data/docs/UsageAttributionSliceByProduct.md +34 -0
- data/docs/UsageMetering.md +5 -1
- data/docs/UsageMeteringAttribution.md +26 -0
- data/docs/UsageMeteringScope.md +49 -0
- data/docs/UsageMeteringScopeOneOf.md +18 -0
- data/lib/zernio-sdk/api/usage_api.rb +15 -2
- data/lib/zernio-sdk/models/usage_attribution_group.rb +190 -0
- data/lib/zernio-sdk/models/usage_attribution_slice.rb +156 -0
- data/lib/zernio-sdk/models/usage_attribution_slice_by_product.rb +220 -0
- data/lib/zernio-sdk/models/usage_metering.rb +22 -4
- data/lib/zernio-sdk/models/usage_metering_attribution.rb +223 -0
- data/lib/zernio-sdk/models/usage_metering_call_usage.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_peaks.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_scope.rb +105 -0
- data/lib/zernio-sdk/models/usage_metering_scope_one_of.rb +164 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +6 -0
- data/openapi.yaml +90 -4
- data/spec/api/usage_api_spec.rb +4 -1
- data/spec/models/usage_attribution_group_spec.rb +48 -0
- data/spec/models/usage_attribution_slice_by_product_spec.rb +84 -0
- data/spec/models/usage_attribution_slice_spec.rb +42 -0
- data/spec/models/usage_metering_attribution_spec.rb +64 -0
- data/spec/models/usage_metering_scope_one_of_spec.rb +36 -0
- data/spec/models/usage_metering_scope_spec.rb +32 -0
- data/spec/models/usage_metering_spec.rb +12 -0
- data/zernio-sdk-0.0.783.gem +0 -0
- metadata +26 -2
- data/zernio-sdk-0.0.782.gem +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class UsageAttributionSlice < ApiModelBase
|
|
18
|
+
attr_accessor :by_product
|
|
19
|
+
|
|
20
|
+
attr_accessor :total_usd
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'by_product' => :'byProduct',
|
|
26
|
+
:'total_usd' => :'totalUsd'
|
|
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
|
+
:'by_product' => :'UsageAttributionSliceByProduct',
|
|
44
|
+
:'total_usd' => :'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 `Zernio::UsageAttributionSlice` 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 `Zernio::UsageAttributionSlice`. 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?(:'by_product')
|
|
71
|
+
self.by_product = attributes[:'by_product']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'total_usd')
|
|
75
|
+
self.total_usd = attributes[:'total_usd']
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
80
|
+
# @return Array for valid properties with the reasons
|
|
81
|
+
def list_invalid_properties
|
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
83
|
+
invalid_properties = Array.new
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
by_product == o.by_product &&
|
|
100
|
+
total_usd == o.total_usd
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# @see the `==` method
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def eql?(o)
|
|
106
|
+
self == o
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Calculates hash code according to all attributes.
|
|
110
|
+
# @return [Integer] Hash code
|
|
111
|
+
def hash
|
|
112
|
+
[by_product, total_usd].hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Builds the object from hash
|
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
117
|
+
# @return [Object] Returns the model itself
|
|
118
|
+
def self.build_from_hash(attributes)
|
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
|
120
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
121
|
+
transformed_hash = {}
|
|
122
|
+
openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = nil
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
new(transformed_hash)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Returns the object in the form of hash
|
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
|
140
|
+
def to_hash
|
|
141
|
+
hash = {}
|
|
142
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
143
|
+
value = self.send(attr)
|
|
144
|
+
if value.nil?
|
|
145
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
146
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
hash[param] = _to_hash(value)
|
|
150
|
+
end
|
|
151
|
+
hash
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
# USD per product family.
|
|
18
|
+
class UsageAttributionSliceByProduct < ApiModelBase
|
|
19
|
+
attr_accessor :accounts
|
|
20
|
+
|
|
21
|
+
attr_accessor :numbers
|
|
22
|
+
|
|
23
|
+
attr_accessor :calls
|
|
24
|
+
|
|
25
|
+
attr_accessor :sms
|
|
26
|
+
|
|
27
|
+
attr_accessor :verify
|
|
28
|
+
|
|
29
|
+
attr_accessor :dlc
|
|
30
|
+
|
|
31
|
+
attr_accessor :x_api
|
|
32
|
+
|
|
33
|
+
attr_accessor :credits
|
|
34
|
+
|
|
35
|
+
attr_accessor :other
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'accounts' => :'accounts',
|
|
41
|
+
:'numbers' => :'numbers',
|
|
42
|
+
:'calls' => :'calls',
|
|
43
|
+
:'sms' => :'sms',
|
|
44
|
+
:'verify' => :'verify',
|
|
45
|
+
:'dlc' => :'dlc',
|
|
46
|
+
:'x_api' => :'xApi',
|
|
47
|
+
:'credits' => :'credits',
|
|
48
|
+
:'other' => :'other'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'accounts' => :'Float',
|
|
66
|
+
:'numbers' => :'Float',
|
|
67
|
+
:'calls' => :'Float',
|
|
68
|
+
:'sms' => :'Float',
|
|
69
|
+
:'verify' => :'Float',
|
|
70
|
+
:'dlc' => :'Float',
|
|
71
|
+
:'x_api' => :'Float',
|
|
72
|
+
:'credits' => :'Float',
|
|
73
|
+
:'other' => :'Float'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# List of attributes with nullable: true
|
|
78
|
+
def self.openapi_nullable
|
|
79
|
+
Set.new([
|
|
80
|
+
])
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Initializes the object
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
def initialize(attributes = {})
|
|
86
|
+
if (!attributes.is_a?(Hash))
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UsageAttributionSliceByProduct` initialize method"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UsageAttributionSliceByProduct`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
|
+
end
|
|
96
|
+
h[k.to_sym] = v
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'accounts')
|
|
100
|
+
self.accounts = attributes[:'accounts']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'numbers')
|
|
104
|
+
self.numbers = attributes[:'numbers']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'calls')
|
|
108
|
+
self.calls = attributes[:'calls']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'sms')
|
|
112
|
+
self.sms = attributes[:'sms']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'verify')
|
|
116
|
+
self.verify = attributes[:'verify']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'dlc')
|
|
120
|
+
self.dlc = attributes[:'dlc']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'x_api')
|
|
124
|
+
self.x_api = attributes[:'x_api']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'credits')
|
|
128
|
+
self.credits = attributes[:'credits']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'other')
|
|
132
|
+
self.other = attributes[:'other']
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
137
|
+
# @return Array for valid properties with the reasons
|
|
138
|
+
def list_invalid_properties
|
|
139
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
140
|
+
invalid_properties = Array.new
|
|
141
|
+
invalid_properties
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Check to see if the all the properties in the model are valid
|
|
145
|
+
# @return true if the model is valid
|
|
146
|
+
def valid?
|
|
147
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
148
|
+
true
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Checks equality by comparing each attribute.
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def ==(o)
|
|
154
|
+
return true if self.equal?(o)
|
|
155
|
+
self.class == o.class &&
|
|
156
|
+
accounts == o.accounts &&
|
|
157
|
+
numbers == o.numbers &&
|
|
158
|
+
calls == o.calls &&
|
|
159
|
+
sms == o.sms &&
|
|
160
|
+
verify == o.verify &&
|
|
161
|
+
dlc == o.dlc &&
|
|
162
|
+
x_api == o.x_api &&
|
|
163
|
+
credits == o.credits &&
|
|
164
|
+
other == o.other
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @see the `==` method
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def eql?(o)
|
|
170
|
+
self == o
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Calculates hash code according to all attributes.
|
|
174
|
+
# @return [Integer] Hash code
|
|
175
|
+
def hash
|
|
176
|
+
[accounts, numbers, calls, sms, verify, dlc, x_api, credits, other].hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Builds the object from hash
|
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
181
|
+
# @return [Object] Returns the model itself
|
|
182
|
+
def self.build_from_hash(attributes)
|
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
|
184
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
185
|
+
transformed_hash = {}
|
|
186
|
+
openapi_types.each_pair do |key, type|
|
|
187
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = nil
|
|
189
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
190
|
+
# check to ensure the input is an array given that the attribute
|
|
191
|
+
# is documented as an array but the input is not
|
|
192
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
193
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
194
|
+
end
|
|
195
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
196
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
new(transformed_hash)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the object in the form of hash
|
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
|
204
|
+
def to_hash
|
|
205
|
+
hash = {}
|
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
207
|
+
value = self.send(attr)
|
|
208
|
+
if value.nil?
|
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
hash[param] = _to_hash(value)
|
|
214
|
+
end
|
|
215
|
+
hash
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
@@ -37,6 +37,10 @@ module Zernio
|
|
|
37
37
|
|
|
38
38
|
attr_accessor :tax
|
|
39
39
|
|
|
40
|
+
attr_accessor :attribution
|
|
41
|
+
|
|
42
|
+
attr_accessor :scope
|
|
43
|
+
|
|
40
44
|
class EnumAttributeValidator
|
|
41
45
|
attr_reader :datatype
|
|
42
46
|
attr_reader :allowable_values
|
|
@@ -70,7 +74,9 @@ module Zernio
|
|
|
70
74
|
:'peaks' => :'peaks',
|
|
71
75
|
:'call_usage' => :'callUsage',
|
|
72
76
|
:'period' => :'period',
|
|
73
|
-
:'tax' => :'tax'
|
|
77
|
+
:'tax' => :'tax',
|
|
78
|
+
:'attribution' => :'attribution',
|
|
79
|
+
:'scope' => :'scope'
|
|
74
80
|
}
|
|
75
81
|
end
|
|
76
82
|
|
|
@@ -95,7 +101,9 @@ module Zernio
|
|
|
95
101
|
:'peaks' => :'UsageMeteringPeaks',
|
|
96
102
|
:'call_usage' => :'UsageMeteringCallUsage',
|
|
97
103
|
:'period' => :'UsageMeteringPeriod',
|
|
98
|
-
:'tax' => :'UsageMeteringTax'
|
|
104
|
+
:'tax' => :'UsageMeteringTax',
|
|
105
|
+
:'attribution' => :'UsageMeteringAttribution',
|
|
106
|
+
:'scope' => :'UsageMeteringScope'
|
|
99
107
|
}
|
|
100
108
|
end
|
|
101
109
|
|
|
@@ -160,6 +168,14 @@ module Zernio
|
|
|
160
168
|
if attributes.key?(:'tax')
|
|
161
169
|
self.tax = attributes[:'tax']
|
|
162
170
|
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'attribution')
|
|
173
|
+
self.attribution = attributes[:'attribution']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'scope')
|
|
177
|
+
self.scope = attributes[:'scope']
|
|
178
|
+
end
|
|
163
179
|
end
|
|
164
180
|
|
|
165
181
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -202,7 +218,9 @@ module Zernio
|
|
|
202
218
|
peaks == o.peaks &&
|
|
203
219
|
call_usage == o.call_usage &&
|
|
204
220
|
period == o.period &&
|
|
205
|
-
tax == o.tax
|
|
221
|
+
tax == o.tax &&
|
|
222
|
+
attribution == o.attribution &&
|
|
223
|
+
scope == o.scope
|
|
206
224
|
end
|
|
207
225
|
|
|
208
226
|
# @see the `==` method
|
|
@@ -214,7 +232,7 @@ module Zernio
|
|
|
214
232
|
# Calculates hash code according to all attributes.
|
|
215
233
|
# @return [Integer] Hash code
|
|
216
234
|
def hash
|
|
217
|
-
[supported, granularity, days, totals, line_items, peaks, call_usage, period, tax].hash
|
|
235
|
+
[supported, granularity, days, totals, line_items, peaks, call_usage, period, tax, attribution, scope].hash
|
|
218
236
|
end
|
|
219
237
|
|
|
220
238
|
# Builds the object from hash
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
# Present with `groupBy`. The window's spend split per profile or account; `sum(groups) + unattributed` equals `totals` per product.
|
|
18
|
+
class UsageMeteringAttribution < ApiModelBase
|
|
19
|
+
attr_accessor :group_by
|
|
20
|
+
|
|
21
|
+
attr_accessor :groups
|
|
22
|
+
|
|
23
|
+
# Spend no profile/account can claim: credits, 10DLC fees, Verify, and usage whose record no longer resolves to an account. Zero for a restricted principal.
|
|
24
|
+
attr_accessor :unattributed
|
|
25
|
+
|
|
26
|
+
# The window totals; for a restricted principal, the sum of the visible groups.
|
|
27
|
+
attr_accessor :totals
|
|
28
|
+
|
|
29
|
+
# True when the caller (profile-scoped API key or member) cannot see every profile: `groups` are filtered, `totals` sum them, `unattributed` is zero, and the top-level `days` / `totals` / `lineItems` are projected onto the visible groups with `peaks`, `callUsage` and `tax` null.
|
|
30
|
+
attr_accessor :restricted
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'group_by' => :'groupBy',
|
|
58
|
+
:'groups' => :'groups',
|
|
59
|
+
:'unattributed' => :'unattributed',
|
|
60
|
+
:'totals' => :'totals',
|
|
61
|
+
:'restricted' => :'restricted'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns attribute mapping this model knows about
|
|
66
|
+
def self.acceptable_attribute_map
|
|
67
|
+
attribute_map
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
acceptable_attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'group_by' => :'String',
|
|
79
|
+
:'groups' => :'Array<UsageAttributionGroup>',
|
|
80
|
+
:'unattributed' => :'UsageAttributionSlice',
|
|
81
|
+
:'totals' => :'UsageAttributionSlice',
|
|
82
|
+
:'restricted' => :'Boolean'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Initializes the object
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
def initialize(attributes = {})
|
|
95
|
+
if (!attributes.is_a?(Hash))
|
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UsageMeteringAttribution` initialize method"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UsageMeteringAttribution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'group_by')
|
|
109
|
+
self.group_by = attributes[:'group_by']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'groups')
|
|
113
|
+
if (value = attributes[:'groups']).is_a?(Array)
|
|
114
|
+
self.groups = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'unattributed')
|
|
119
|
+
self.unattributed = attributes[:'unattributed']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'totals')
|
|
123
|
+
self.totals = attributes[:'totals']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'restricted')
|
|
127
|
+
self.restricted = attributes[:'restricted']
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
132
|
+
# @return Array for valid properties with the reasons
|
|
133
|
+
def list_invalid_properties
|
|
134
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
135
|
+
invalid_properties = Array.new
|
|
136
|
+
invalid_properties
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Check to see if the all the properties in the model are valid
|
|
140
|
+
# @return true if the model is valid
|
|
141
|
+
def valid?
|
|
142
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
143
|
+
group_by_validator = EnumAttributeValidator.new('String', ["profile", "account"])
|
|
144
|
+
return false unless group_by_validator.valid?(@group_by)
|
|
145
|
+
true
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
149
|
+
# @param [Object] group_by Object to be assigned
|
|
150
|
+
def group_by=(group_by)
|
|
151
|
+
validator = EnumAttributeValidator.new('String', ["profile", "account"])
|
|
152
|
+
unless validator.valid?(group_by)
|
|
153
|
+
fail ArgumentError, "invalid value for \"group_by\", must be one of #{validator.allowable_values}."
|
|
154
|
+
end
|
|
155
|
+
@group_by = group_by
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Checks equality by comparing each attribute.
|
|
159
|
+
# @param [Object] Object to be compared
|
|
160
|
+
def ==(o)
|
|
161
|
+
return true if self.equal?(o)
|
|
162
|
+
self.class == o.class &&
|
|
163
|
+
group_by == o.group_by &&
|
|
164
|
+
groups == o.groups &&
|
|
165
|
+
unattributed == o.unattributed &&
|
|
166
|
+
totals == o.totals &&
|
|
167
|
+
restricted == o.restricted
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# @see the `==` method
|
|
171
|
+
# @param [Object] Object to be compared
|
|
172
|
+
def eql?(o)
|
|
173
|
+
self == o
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Calculates hash code according to all attributes.
|
|
177
|
+
# @return [Integer] Hash code
|
|
178
|
+
def hash
|
|
179
|
+
[group_by, groups, unattributed, totals, restricted].hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Builds the object from hash
|
|
183
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
184
|
+
# @return [Object] Returns the model itself
|
|
185
|
+
def self.build_from_hash(attributes)
|
|
186
|
+
return nil unless attributes.is_a?(Hash)
|
|
187
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
188
|
+
transformed_hash = {}
|
|
189
|
+
openapi_types.each_pair do |key, type|
|
|
190
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = nil
|
|
192
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
193
|
+
# check to ensure the input is an array given that the attribute
|
|
194
|
+
# is documented as an array but the input is not
|
|
195
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
196
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
197
|
+
end
|
|
198
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
199
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
new(transformed_hash)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
if value.nil?
|
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
hash[param] = _to_hash(value)
|
|
217
|
+
end
|
|
218
|
+
hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Billable call volumes over the window.
|
|
17
|
+
# Billable call volumes over the window. Null when `profileId` / `accountId` is set.
|
|
18
18
|
class UsageMeteringCallUsage < ApiModelBase
|
|
19
19
|
attr_accessor :whatsapp
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Peak counts over the window (Metronome COUNT metrics + live active-number count).
|
|
17
|
+
# Peak counts over the window (Metronome COUNT metrics + live active-number count). Null when `profileId` / `accountId` is set.
|
|
18
18
|
class UsageMeteringPeaks < ApiModelBase
|
|
19
19
|
attr_accessor :accounts
|
|
20
20
|
|