Class: Twilio::REST::Wireless::V1::RatePlanInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/wireless/v1/rate_plan.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ RatePlanInstance

Initialize the RatePlanInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this resource.



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 287

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'unique_name' => payload['unique_name'],
      'account_sid' => payload['account_sid'],
      'friendly_name' => payload['friendly_name'],
      'data_enabled' => payload['data_enabled'],
      'data_metering' => payload['data_metering'],
      'data_limit' => payload['data_limit'].to_i,
      'messaging_enabled' => payload['messaging_enabled'],
      'voice_enabled' => payload['voice_enabled'],
      'national_roaming_enabled' => payload['national_roaming_enabled'],
      'national_roaming_data_limit' => payload['national_roaming_data_limit'].to_i,
      'international_roaming' => payload['international_roaming'],
      'international_roaming_data_limit' => payload['international_roaming_data_limit'].to_i,
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The unique id of the Account that this Rate Plan belongs to.

Returns:

  • (String)

    The unique id of the Account that this Rate Plan belongs to.



340
341
342
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 340

def 
  @properties['account_sid']
end

#contextRatePlanContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



319
320
321
322
323
324
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 319

def context
  unless @instance_context
    @instance_context = RatePlanContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#data_enabledBoolean

Returns Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity.

Returns:

  • (Boolean)

    Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity.



352
353
354
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 352

def data_enabled
  @properties['data_enabled']
end

#data_limitString

Returns Network-enforced limit specifying the total Megabytes of data usage allowed during one month on the ‘home’ (T-Mobile USA) network.

Returns:

  • (String)

    Network-enforced limit specifying the total Megabytes of data usage allowed during one month on the ‘home’ (T-Mobile USA) network.



364
365
366
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 364

def data_limit
  @properties['data_limit']
end

#data_meteringString

Returns The model by which to meter data usage, in accordance with the available data metering models.

Returns:

  • (String)

    The model by which to meter data usage, in accordance with the available data metering models.



358
359
360
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 358

def data_metering
  @properties['data_metering']
end

#date_createdTime

Returns The date that this resource was created, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date that this resource was created, given as GMT in ISO 8601 format.



406
407
408
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 406

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was last updated, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date that this resource was last updated, given as GMT in ISO 8601 format.



412
413
414
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 412

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the RatePlanInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



443
444
445
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 443

def delete
  context.delete
end

#fetchRatePlanInstance

Fetch a RatePlanInstance

Returns:



425
426
427
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 425

def fetch
  context.fetch
end

#friendly_nameString

Returns A user-provided string that identifies this resource.

Returns:

  • (String)

    A user-provided string that identifies this resource.



346
347
348
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 346

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



456
457
458
459
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 456

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Wireless.V1.RatePlanInstance #{values}>"
end

#international_roamingString

Returns Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity and messaging outside of the United States.

Returns:

  • (String)

    Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity and messaging outside of the United States.



394
395
396
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 394

def international_roaming
  @properties['international_roaming']
end

#international_roaming_data_limitString

Returns Network-enforced limit specifying the total Megabytes of ‘international roaming’ (non-US) data usage (download and upload combined) allowed during one month.

Returns:

  • (String)

    Network-enforced limit specifying the total Megabytes of ‘international roaming’ (non-US) data usage (download and upload combined) allowed during one month.



400
401
402
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 400

def international_roaming_data_limit
  @properties['international_roaming_data_limit']
end

#messaging_enabledBoolean

Returns Defines whether SIMs are capable of making and sending and receiving SMS via Commands.

Returns:

  • (Boolean)

    Defines whether SIMs are capable of making and sending and receiving SMS via Commands.



370
371
372
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 370

def messaging_enabled
  @properties['messaging_enabled']
end

#national_roaming_data_limitString

Returns Network-enforced limit specifying the total Megabytes of ‘national roaming’ data usage allowed during one month on networks in the United States other than the ‘home’ (T-Mobile USA) network.

Returns:

  • (String)

    Network-enforced limit specifying the total Megabytes of ‘national roaming’ data usage allowed during one month on networks in the United States other than the ‘home’ (T-Mobile USA) network.



388
389
390
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 388

def national_roaming_data_limit
  @properties['national_roaming_data_limit']
end

#national_roaming_enabledBoolean

Returns Defines whether SIMs can roam onto networks other than the ‘home’ (T-Mobile USA) network in the United States.

Returns:

  • (Boolean)

    Defines whether SIMs can roam onto networks other than the ‘home’ (T-Mobile USA) network in the United States.



382
383
384
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 382

def national_roaming_enabled
  @properties['national_roaming_enabled']
end

#sidString

Returns A 34 character string that uniquely identifies this resource.

Returns:

  • (String)

    A 34 character string that uniquely identifies this resource.



328
329
330
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 328

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



449
450
451
452
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 449

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Wireless.V1.RatePlanInstance #{values}>"
end

#unique_nameString

Returns A user-provided string that uniquely identifies this resource as an alternative to the sid.

Returns:

  • (String)

    A user-provided string that uniquely identifies this resource as an alternative to the sid.



334
335
336
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 334

def unique_name
  @properties['unique_name']
end

#update(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance

Update the RatePlanInstance

Parameters:

  • unique_name (String) (defaults to: :unset)

    A user-provided string that uniquely identifies this resource as an alternative to the Sid.

  • friendly_name (String) (defaults to: :unset)

    A user-provided string that identifies this resource. Non-unique.

Returns:



436
437
438
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 436

def update(unique_name: :unset, friendly_name: :unset)
  context.update(unique_name: unique_name, friendly_name: friendly_name, )
end

#urlString

Returns The URL for this resource.

Returns:

  • (String)

    The URL for this resource.



418
419
420
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 418

def url
  @properties['url']
end

#voice_enabledBoolean

Returns Defines whether SIMs are capable of making and receiving voice calls.

Returns:

  • (Boolean)

    Defines whether SIMs are capable of making and receiving voice calls.



376
377
378
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 376

def voice_enabled
  @properties['voice_enabled']
end