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

  • account_sid (String)

    The SID of the Account that created this RatePlan resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 593

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'] == nil ? payload['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'] == nil ? payload['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'] == nil ? payload['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](www.twilio.com/docs/iam/api/account) that created the RatePlan resource.

Returns:



647
648
649
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 647

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:



626
627
628
629
630
631
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 626

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.



659
660
661
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 659

def data_enabled
    @properties['data_enabled']
end

#data_limitString

Returns The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB.

Returns:

  • (String)

    The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB.



671
672
673
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 671

def data_limit
    @properties['data_limit']
end

#data_meteringString

Returns The model used to meter data usage. Can be: payg and quota-1, quota-10, and quota-50. Learn more about the available [data metering models](www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans).

Returns:



665
666
667
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 665

def data_metering
    @properties['data_metering']
end

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.

Returns:



713
714
715
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 713

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.

Returns:



719
720
721
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 719

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the RatePlanInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



732
733
734
735
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 732

def delete

    context.delete
end

#fetchRatePlanInstance

Fetch the RatePlanInstance

Returns:



740
741
742
743
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 740

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.



653
654
655
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 653

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



770
771
772
773
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 770

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

#international_roamingArray<String>

Returns The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: data and messaging.

Returns:

  • (Array<String>)

    The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: data and messaging.



701
702
703
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 701

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. Can be up to 2TB.

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. Can be up to 2TB.



707
708
709
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 707

def international_roaming_data_limit
    @properties['international_roaming_data_limit']
end

#messaging_enabledBoolean

Returns Whether SIMs can make, send, and receive SMS using [Commands](www.twilio.com/docs/iot/wireless/api/command-resource).

Returns:



677
678
679
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 677

def messaging_enabled
    @properties['messaging_enabled']
end

#national_roaming_data_limitString

Returns The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB.

Returns:

  • (String)

    The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB.



695
696
697
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 695

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 (T-Mobile USA) in the United States. See [national roaming](www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming).

Returns:



689
690
691
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 689

def national_roaming_enabled
    @properties['national_roaming_enabled']
end

#sidString

Returns The unique string that we created to identify the RatePlan resource.

Returns:

  • (String)

    The unique string that we created to identify the RatePlan resource.



635
636
637
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 635

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



763
764
765
766
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 763

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. It can be used in place of the resource’s sid in the URL to address the resource.

Returns:

  • (String)

    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.



641
642
643
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 641

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:



750
751
752
753
754
755
756
757
758
759
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 750

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.



725
726
727
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 725

def url
    @properties['url']
end

#voice_enabledBoolean

Returns Deprecated. Whether SIMs can make and receive voice calls.

Returns:

  • (Boolean)

    Deprecated. Whether SIMs can make and receive voice calls.



683
684
685
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 683

def voice_enabled
    @properties['voice_enabled']
end