Class: Twilio::REST::Api::V2010::AccountContext::UsageList::RecordInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/usage/record.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil) ⇒ RecordInstance

Initialize the RecordInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil) —

    The SID of the Account that created this Record resource.

  • sid (String) —

    The SID of the Call resource to fetch.



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 358

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'],
        '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 that accrued the usage.

Returns:

  • (String) —

    The SID of the Account that accrued the usage.



385
386
387
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 385

def 
    @properties['account_sid']
end

#api_version ⇒ String

Returns The API version used to create the resource.

Returns:

  • (String) —

    The API version used to create the resource.



391
392
393
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 391

def api_version
    @properties['api_version']
end

#as_of ⇒ String

Returns Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT.

Returns:

  • (String) —

    Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT



397
398
399
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 397

def as_of
    @properties['as_of']
end

#category ⇒ String

Returns The category of usage. For more information, see Usage Categories.

Returns:

  • (String) —

    The category of usage. For more information, see Usage Categories.



403
404
405
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 403

def category
    @properties['category']
end

#count ⇒ String

Returns The number of usage events, such as the number of calls.

Returns:

  • (String) —

    The number of usage events, such as the number of calls.



409
410
411
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 409

def count
    @properties['count']
end

#count_unit ⇒ String

Returns The units in which count is measured, such as calls for calls or messages for SMS.

Returns:

  • (String) —

    The units in which count is measured, such as calls for calls or messages for SMS.



415
416
417
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 415

def count_unit
    @properties['count_unit']
end

#description ⇒ String

Returns A plain-language description of the usage category.

Returns:

  • (String) —

    A plain-language description of the usage category.



421
422
423
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 421

def description
    @properties['description']
end

#end_date ⇒ Date

Returns The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.

Returns:

  • (Date) —

    The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.



427
428
429
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 427

def end_date
    @properties['end_date']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



481
482
483
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 481

def inspect
    "<Twilio.Api.V2010.RecordInstance>"
end

#price ⇒ Float

Returns The total price of the usage in the currency specified in price_unit and associated with the account.

Returns:

  • (Float) —

    The total price of the usage in the currency specified in price_unit and associated with the account.



433
434
435
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 433

def price
    @properties['price']
end

#price_unit ⇒ String

Returns The currency in which price is measured, in ISO 4127 format, such as usd, eur, and jpy.

Returns:

  • (String) —

    The currency in which price is measured, in ISO 4127 format, such as usd, eur, and jpy.



439
440
441
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 439

def price_unit
    @properties['price_unit']
end

#start_date ⇒ Date

Returns The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.

Returns:

  • (Date) —

    The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as YYYY-MM-DD.



445
446
447
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 445

def start_date
    @properties['start_date']
end

#subresource_uris ⇒ Hash

Returns A list of related resources identified by their URIs. For more information, see List Subresources.

Returns:

  • (Hash) —

    A list of related resources identified by their URIs. For more information, see List Subresources.



451
452
453
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 451

def subresource_uris
    @properties['subresource_uris']
end

#to_s ⇒ Object

Provide a user friendly representation



475
476
477
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 475

def to_s
    "<Twilio.Api.V2010.RecordInstance>"
end

#uri ⇒ String

Returns The URI of the resource, relative to https://api.twilio.com.

Returns:

  • (String) —

    The URI of the resource, relative to https://api.twilio.com.



457
458
459
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 457

def uri
    @properties['uri']
end

#usage ⇒ String

Returns The amount used to bill usage and measured in units described in usage_unit.

Returns:

  • (String) —

    The amount used to bill usage and measured in units described in usage_unit.



463
464
465
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 463

def usage
    @properties['usage']
end

#usage_unit ⇒ String

Returns The units in which usage is measured, such as minutes for calls or messages for SMS.

Returns:

  • (String) —

    The units in which usage is measured, such as minutes for calls or messages for SMS.



469
470
471
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record.rb', line 469

def usage_unit
    @properties['usage_unit']
end