Class: Twilio::REST::Supersim::V1::FleetInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the FleetInstance



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 581

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'sid' => payload['sid'],
        'unique_name' => payload['unique_name'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'data_enabled' => payload['data_enabled'],
        'data_limit' => payload['data_limit'] == nil ? payload['data_limit'] : payload['data_limit'].to_i,
        'data_metering' => payload['data_metering'],
        'sms_commands_enabled' => payload['sms_commands_enabled'],
        'sms_commands_url' => payload['sms_commands_url'],
        'sms_commands_method' => payload['sms_commands_method'],
        'network_access_profile_sid' => payload['network_access_profile_sid'],
        'ip_commands_url' => payload['ip_commands_url'],
        'ip_commands_method' => payload['ip_commands_method'],
    }

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

Instance Method Details

#account_sidString



622
623
624
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 622

def 
    @properties['account_sid']
end

#contextFleetContext

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



613
614
615
616
617
618
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 613

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

#data_enabledBoolean



658
659
660
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 658

def data_enabled
    @properties['data_enabled']
end

#data_limitString



664
665
666
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 664

def data_limit
    @properties['data_limit']
end

#data_meteringDataMetering



670
671
672
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 670

def data_metering
    @properties['data_metering']
end

#date_createdTime



640
641
642
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 640

def date_created
    @properties['date_created']
end

#date_updatedTime



646
647
648
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 646

def date_updated
    @properties['date_updated']
end

#fetchFleetInstance

Fetch the FleetInstance



713
714
715
716
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 713

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



758
759
760
761
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 758

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

#ip_commands_methodString



706
707
708
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 706

def ip_commands_method
    @properties['ip_commands_method']
end

#ip_commands_urlString



700
701
702
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 700

def ip_commands_url
    @properties['ip_commands_url']
end

#network_access_profile_sidString



694
695
696
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 694

def network_access_profile_sid
    @properties['network_access_profile_sid']
end

#sidString



628
629
630
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 628

def sid
    @properties['sid']
end

#sms_commands_enabledBoolean



676
677
678
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 676

def sms_commands_enabled
    @properties['sms_commands_enabled']
end

#sms_commands_methodString



688
689
690
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 688

def sms_commands_method
    @properties['sms_commands_method']
end

#sms_commands_urlString



682
683
684
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 682

def sms_commands_url
    @properties['sms_commands_url']
end

#to_sObject

Provide a user friendly representation



751
752
753
754
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 751

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

#unique_nameString



634
635
636
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 634

def unique_name
    @properties['unique_name']
end

#update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset, data_limit: :unset) ⇒ FleetInstance

Update the FleetInstance



728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 728

def update(
    unique_name: :unset, 
    network_access_profile: :unset, 
    ip_commands_url: :unset, 
    ip_commands_method: :unset, 
    sms_commands_url: :unset, 
    sms_commands_method: :unset, 
    data_limit: :unset
)

    context.update(
        unique_name: unique_name, 
        network_access_profile: network_access_profile, 
        ip_commands_url: ip_commands_url, 
        ip_commands_method: ip_commands_method, 
        sms_commands_url: sms_commands_url, 
        sms_commands_method: sms_commands_method, 
        data_limit: data_limit, 
    )
end

#urlString



652
653
654
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 652

def url
    @properties['url']
end