Class: Twilio::REST::Api::V2010::AccountContext::UsageList::RecordList::MonthlyInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the MonthlyInstance

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 Monthly resource.

  • sid (String)

    The SID of the Call resource to fetch.



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 196

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_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that accrued the usage.

Returns:



222
223
224
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 222

def 
    @properties['account_sid']
end

#api_versionString

Returns The API version used to create the resource.

Returns:

  • (String)

    The API version used to create the resource.



228
229
230
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 228

def api_version
    @properties['api_version']
end

#as_ofString

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



234
235
236
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 234

def as_of
    @properties['as_of']
end

#categoryCategory

Returns:

  • (Category)


240
241
242
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 240

def category
    @properties['category']
end

#countString

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.



246
247
248
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 246

def count
    @properties['count']
end

#count_unitString

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.



252
253
254
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 252

def count_unit
    @properties['count_unit']
end

#descriptionString

Returns A plain-language description of the usage category.

Returns:

  • (String)

    A plain-language description of the usage category.



258
259
260
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 258

def description
    @properties['description']
end

#end_dateDate

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`.



264
265
266
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 264

def end_date
    @properties['end_date']
end

#inspectObject

Provide a detailed, user friendly representation



318
319
320
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 318

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

#priceFloat

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.



270
271
272
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 270

def price
    @properties['price']
end

#price_unitString

Returns The currency in which ‘price` is measured, in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`.

Returns:



276
277
278
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 276

def price_unit
    @properties['price_unit']
end

#start_dateDate

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`.



282
283
284
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 282

def start_date
    @properties['start_date']
end

#subresource_urisHash

Returns A list of related resources identified by their URIs. For more information, see [List Subresources](www.twilio.com/docs/usage/api/usage-record#list-subresources).

Returns:



288
289
290
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 288

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



312
313
314
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 312

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

#uriString

Returns The URI of the resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI of the resource, relative to ‘api.twilio.com`.



294
295
296
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 294

def uri
    @properties['uri']
end

#usageString

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`.



300
301
302
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 300

def usage
    @properties['usage']
end

#usage_unitString

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.



306
307
308
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 306

def usage_unit
    @properties['usage_unit']
end