Class: Twilio::REST::Api::V2010::AccountContext::UsageList::RecordInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::UsageList::RecordInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/usage/record.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account accrued the usage.
-
#api_version ⇒ String
The API version used to create the resource.
-
#as_of ⇒ String
Usage records up to date as of this timestamp.
-
#category ⇒ record.Category
The category of usage.
-
#count ⇒ String
The number of usage events.
-
#count_unit ⇒ String
The units in which count is measured.
-
#description ⇒ String
A plain-language description of the usage category.
-
#end_date ⇒ Date
The last date for which usage is included in the UsageRecord.
-
#initialize(version, payload, account_sid: nil) ⇒ RecordInstance
constructor
Initialize the RecordInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#price ⇒ String
The total price of the usage.
-
#price_unit ⇒ String
The currency in which `price` is measured.
-
#start_date ⇒ Date
The first date for which usage is included in this UsageRecord.
-
#subresource_uris ⇒ String
A list of related resources identified by their relative URIs.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#uri ⇒ String
The URI of the resource, relative to `api.twilio.com`.
-
#usage ⇒ String
The amount of usage.
-
#usage_unit ⇒ String
The units in which usage is measured.
Constructor Details
#initialize(version, payload, account_sid: nil) ⇒ RecordInstance
Initialize the RecordInstance
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 293 def initialize(version, payload, account_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'api_version' => payload['api_version'], 'as_of' => payload['as_of'], 'category' => payload['category'], 'count' => payload['count'], 'count_unit' => payload['count_unit'], 'description' => payload['description'], 'end_date' => Twilio.deserialize_iso8601_date(payload['end_date']), 'price' => payload['price'].to_f, 'price_unit' => payload['price_unit'], 'start_date' => Twilio.deserialize_iso8601_date(payload['start_date']), 'subresource_uris' => payload['subresource_uris'], 'uri' => payload['uri'], 'usage' => payload['usage'], 'usage_unit' => payload['usage_unit'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account accrued the usage.
318 319 320 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 318 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version used to create the resource.
324 325 326 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 324 def api_version @properties['api_version'] end |
#as_of ⇒ String
Returns Usage records up to date as of this timestamp.
330 331 332 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 330 def as_of @properties['as_of'] end |
#category ⇒ record.Category
Returns The category of usage.
336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 336 def category @properties['category'] end |
#count ⇒ String
Returns The number of usage events.
342 343 344 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 342 def count @properties['count'] end |
#count_unit ⇒ String
Returns The units in which count is measured.
348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 348 def count_unit @properties['count_unit'] end |
#description ⇒ String
Returns A plain-language description of the usage category.
354 355 356 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 354 def description @properties['description'] end |
#end_date ⇒ Date
Returns The last date for which usage is included in the UsageRecord.
360 361 362 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 360 def end_date @properties['end_date'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
414 415 416 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 414 def inspect "<Twilio.Api.V2010.RecordInstance>" end |
#price ⇒ String
Returns The total price of the usage.
366 367 368 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 366 def price @properties['price'] end |
#price_unit ⇒ String
Returns The currency in which `price` is measured.
372 373 374 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 372 def price_unit @properties['price_unit'] end |
#start_date ⇒ Date
Returns The first date for which usage is included in this UsageRecord.
378 379 380 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 378 def start_date @properties['start_date'] end |
#subresource_uris ⇒ String
Returns A list of related resources identified by their relative URIs.
384 385 386 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 384 def subresource_uris @properties['subresource_uris'] end |
#to_s ⇒ Object
Provide a user friendly representation
408 409 410 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 408 def to_s "<Twilio.Api.V2010.RecordInstance>" end |
#uri ⇒ String
Returns The URI of the resource, relative to `api.twilio.com`.
390 391 392 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 390 def uri @properties['uri'] end |
#usage ⇒ String
Returns The amount of usage.
396 397 398 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 396 def usage @properties['usage'] end |
#usage_unit ⇒ String
Returns The units in which usage is measured.
402 403 404 |
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 402 def usage_unit @properties['usage_unit'] end |