Class: Zernio::UsageMeteringTotals
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::UsageMeteringTotals
- Defined in:
- lib/zernio-sdk/models/usage_metering_totals.rb
Overview
Sum of each product over the whole window (USD), plus total. Unaffected by granularity.
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#ads ⇒ Object
Returns the value of attribute ads.
-
#calls ⇒ Object
Returns the value of attribute calls.
-
#credits ⇒ Object
Returns the value of attribute credits.
-
#dlc ⇒ Object
Returns the value of attribute dlc.
-
#imessage ⇒ Object
Returns the value of attribute imessage.
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#numbers ⇒ Object
Returns the value of attribute numbers.
-
#other ⇒ Object
Returns the value of attribute other.
-
#sms ⇒ Object
Returns the value of attribute sms.
-
#total ⇒ Object
Returns the value of attribute total.
-
#verify ⇒ Object
Returns the value of attribute verify.
-
#x_api ⇒ Object
Returns the value of attribute x_api.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UsageMeteringTotals
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ UsageMeteringTotals
Initializes the object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 101 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UsageMeteringTotals` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UsageMeteringTotals`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'accounts') self.accounts = attributes[:'accounts'] end if attributes.key?(:'numbers') self.numbers = attributes[:'numbers'] end if attributes.key?(:'imessage') self. = attributes[:'imessage'] end if attributes.key?(:'calls') self.calls = attributes[:'calls'] end if attributes.key?(:'sms') self.sms = attributes[:'sms'] end if attributes.key?(:'messages') self. = attributes[:'messages'] end if attributes.key?(:'verify') self.verify = attributes[:'verify'] end if attributes.key?(:'dlc') self.dlc = attributes[:'dlc'] end if attributes.key?(:'x_api') self.x_api = attributes[:'x_api'] end if attributes.key?(:'ads') self.ads = attributes[:'ads'] end if attributes.key?(:'credits') self.credits = attributes[:'credits'] end if attributes.key?(:'other') self.other = attributes[:'other'] end if attributes.key?(:'total') self.total = attributes[:'total'] end end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts.
19 20 21 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 19 def accounts @accounts end |
#ads ⇒ Object
Returns the value of attribute ads.
37 38 39 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 37 def ads @ads end |
#calls ⇒ Object
Returns the value of attribute calls.
25 26 27 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 25 def calls @calls end |
#credits ⇒ Object
Returns the value of attribute credits.
39 40 41 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 39 def credits @credits end |
#dlc ⇒ Object
Returns the value of attribute dlc.
33 34 35 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 33 def dlc @dlc end |
#imessage ⇒ Object
Returns the value of attribute imessage.
23 24 25 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 23 def @imessage end |
#messages ⇒ Object
Returns the value of attribute messages.
29 30 31 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 29 def @messages end |
#numbers ⇒ Object
Returns the value of attribute numbers.
21 22 23 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 21 def numbers @numbers end |
#other ⇒ Object
Returns the value of attribute other.
41 42 43 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 41 def other @other end |
#sms ⇒ Object
Returns the value of attribute sms.
27 28 29 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 27 def sms @sms end |
#total ⇒ Object
Returns the value of attribute total.
43 44 45 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 43 def total @total end |
#verify ⇒ Object
Returns the value of attribute verify.
31 32 33 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 31 def verify @verify end |
#x_api ⇒ Object
Returns the value of attribute x_api.
35 36 37 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 35 def x_api @x_api end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
65 66 67 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 65 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
70 71 72 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 70 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 46 def self.attribute_map { :'accounts' => :'accounts', :'numbers' => :'numbers', :'imessage' => :'imessage', :'calls' => :'calls', :'sms' => :'sms', :'messages' => :'messages', :'verify' => :'verify', :'dlc' => :'dlc', :'x_api' => :'xApi', :'ads' => :'ads', :'credits' => :'credits', :'other' => :'other', :'total' => :'total' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 218 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
94 95 96 97 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 94 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 75 def self.openapi_types { :'accounts' => :'Float', :'numbers' => :'Float', :'imessage' => :'Float', :'calls' => :'Float', :'sms' => :'Float', :'messages' => :'Float', :'verify' => :'Float', :'dlc' => :'Float', :'x_api' => :'Float', :'ads' => :'Float', :'credits' => :'Float', :'other' => :'Float', :'total' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 185 def ==(o) return true if self.equal?(o) self.class == o.class && accounts == o.accounts && numbers == o.numbers && == o. && calls == o.calls && sms == o.sms && == o. && verify == o.verify && dlc == o.dlc && x_api == o.x_api && ads == o.ads && credits == o.credits && other == o.other && total == o.total end |
#eql?(o) ⇒ Boolean
205 206 207 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 205 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
211 212 213 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 211 def hash [accounts, numbers, , calls, sms, , verify, dlc, x_api, ads, credits, other, total].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
170 171 172 173 174 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 170 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 240 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
178 179 180 181 |
# File 'lib/zernio-sdk/models/usage_metering_totals.rb', line 178 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |