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



222
223
224
225
226
227
228
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 222

def initialize(version, sid)
  super(version)

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

Instance Method Details

#fetchFleetInstance

Fetch the FleetInstance



233
234
235
236
237
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 233

def fetch
  payload = @version.fetch('GET', @uri)

  FleetInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation



286
287
288
289
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 286

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

#to_sObject

Provide a user friendly representation



279
280
281
282
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 279

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, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset) ⇒ FleetInstance

Update the FleetInstance



262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 262

def update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
  data = Twilio::Values.of({
      'UniqueName' => unique_name,
      'NetworkAccessProfile' => network_access_profile,
      'CommandsUrl' => commands_url,
      'CommandsMethod' => commands_method,
      'SmsCommandsUrl' => sms_commands_url,
      'SmsCommandsMethod' => sms_commands_method,
  })

  payload = @version.update('POST', @uri, data: data)

  FleetInstance.new(@version, payload, sid: @solution[:sid], )
end