Class: Twilio::REST::Supersim::V1::FleetContext

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ FleetContext

Initialize the FleetContext



185
186
187
188
189
190
191
192
193
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 185

def initialize(version, sid)
    super(version)

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/Fleets/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchFleetInstance

Fetch the FleetInstance



197
198
199
200
201
202
203
204
205
206
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 197

def fetch

    
    payload = @version.fetch('GET', @uri)
    FleetInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



257
258
259
260
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 257

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Supersim.V1.FleetContext #{context}>"
end

#to_sObject

Provide a user friendly representation



250
251
252
253
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 250

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Supersim.V1.FleetContext #{context}>"
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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 218

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
)

    data = Twilio::Values.of({
        'UniqueName' => unique_name,
        'NetworkAccessProfile' => network_access_profile,
        'IpCommandsUrl' => ip_commands_url,
        'IpCommandsMethod' => ip_commands_method,
        'SmsCommandsUrl' => sms_commands_url,
        'SmsCommandsMethod' => sms_commands_method,
        'DataLimit' => data_limit,
    })

    
    payload = @version.update('POST', @uri, data: data)
    FleetInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end