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)

    A 34 character string that uniquely identifies this resource.


220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 220

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_sidString

Returns The SID of the Account accrued the usage.

Returns:

  • (String)

    The SID of the Account accrued the usage


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

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


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

def api_version
  @properties['api_version']
end

#as_ofString

Returns Usage records up to date as of this timestamp.

Returns:

  • (String)

    Usage records up to date as of this timestamp


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

def as_of
  @properties['as_of']
end

#categorymonthly.Category

Returns The category of usage.

Returns:

  • (monthly.Category)

    The category of usage


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

def category
  @properties['category']
end

#countString

Returns The number of usage events.

Returns:

  • (String)

    The number of usage events


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

def count
  @properties['count']
end

#count_unitString

Returns The units in which count is measured.

Returns:

  • (String)

    The units in which count is measured


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

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


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

def description
  @properties['description']
end

#end_dateDate

Returns The last date for which usage is included in the UsageRecord.

Returns:

  • (Date)

    The last date for which usage is included in the UsageRecord


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

def end_date
  @properties['end_date']
end

#inspectObject

Provide a detailed, user friendly representation


341
342
343
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 341

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

#priceString

Returns The total price of the usage.

Returns:

  • (String)

    The total price of the usage


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

def price
  @properties['price']
end

#price_unitString

Returns The currency in which `price` is measured.

Returns:

  • (String)

    The currency in which `price` is measured


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

def price_unit
  @properties['price_unit']
end

#start_dateDate

Returns The first date for which usage is included in this UsageRecord.

Returns:

  • (Date)

    The first date for which usage is included in this UsageRecord


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

def start_date
  @properties['start_date']
end

#subresource_urisString

Returns A list of related resources identified by their relative URIs.

Returns:

  • (String)

    A list of related resources identified by their relative URIs


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

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation


335
336
337
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 335

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

#uriString

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

Returns:


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

def uri
  @properties['uri']
end

#usageString

Returns The amount of usage.

Returns:

  • (String)

    The amount of usage


323
324
325
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 323

def usage
  @properties['usage']
end

#usage_unitString

Returns The units in which usage is measured.

Returns:

  • (String)

    The units in which usage is measured


329
330
331
# File 'lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb', line 329

def usage_unit
  @properties['usage_unit']
end