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)

    The SID of the RatePlan resource to fetch.



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

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 SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



337
338
339
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 337

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:



316
317
318
319
320
321
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 316

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

#data_enabledBoolean

Returns Whether SIMs can use GPRS/3G/4G/LTE data connectivity.

Returns:

  • (Boolean)

    Whether SIMs can use GPRS/3G/4G/LTE data connectivity



349
350
351
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 349

def data_enabled
  @properties['data_enabled']
end

#data_limitString

Returns The total data usage in Megabytes that the Network allows during one month on the home network.

Returns:

  • (String)

    The total data usage in Megabytes that the Network allows during one month on the home network



361
362
363
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 361

def data_limit
  @properties['data_limit']
end

#data_meteringString

Returns The model used to meter data usage.

Returns:

  • (String)

    The model used to meter data usage



355
356
357
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 355

def data_metering
  @properties['data_metering']
end

#date_createdTime

Returns The date when the resource was created, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date when the resource was created, given as GMT in ISO 8601 format



403
404
405
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 403

def date_created
  @properties['date_created']
end

#date_updatedTime

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

Returns:

  • (Time)

    The date when the resource was last updated, given as GMT in ISO 8601 format



409
410
411
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 409

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the RatePlanInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



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

def delete
  context.delete
end

#fetchRatePlanInstance

Fetch a RatePlanInstance

Returns:



422
423
424
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 422

def fetch
  context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource



343
344
345
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 343

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#international_roamingString

Returns The services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States.

Returns:

  • (String)

    The services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States



391
392
393
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 391

def international_roaming
  @properties['international_roaming']
end

#international_roaming_data_limitString

Returns The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States.

Returns:

  • (String)

    The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States



397
398
399
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 397

def international_roaming_data_limit
  @properties['international_roaming_data_limit']
end

#messaging_enabledBoolean

Returns Whether SIMs can make, send, and receive SMS using Commands.

Returns:

  • (Boolean)

    Whether SIMs can make, send, and receive SMS using Commands



367
368
369
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 367

def messaging_enabled
  @properties['messaging_enabled']
end

#national_roaming_data_limitString

Returns The total data usage in Megabytes that the Network allows during one month on non-home networks in the United States.

Returns:

  • (String)

    The total data usage in Megabytes that the Network allows during one month on non-home networks in the United States



385
386
387
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 385

def national_roaming_data_limit
  @properties['national_roaming_data_limit']
end

#national_roaming_enabledBoolean

Returns Whether SIMs can roam on networks other than the home network in the United States.

Returns:

  • (Boolean)

    Whether SIMs can roam on networks other than the home network in the United States



379
380
381
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 379

def national_roaming_enabled
  @properties['national_roaming_enabled']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



325
326
327
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 325

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#unique_nameString

Returns An application-defined string that uniquely identifies the resource.

Returns:

  • (String)

    An application-defined string that uniquely identifies the resource



331
332
333
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 331

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)

    An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s ‘sid` in the URL to address the resource.

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

    A descriptive string that you create to describe the resource. It does not have to be unique.

Returns:



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

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



415
416
417
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 415

def url
  @properties['url']
end

#voice_enabledBoolean

Returns Whether SIMs can make and receive voice calls.

Returns:

  • (Boolean)

    Whether SIMs can make and receive voice calls



373
374
375
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 373

def voice_enabled
  @properties['voice_enabled']
end