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

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Fleet resource to fetch.


218
219
220
221
222
223
224
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 218

def initialize(version, sid)
  super(version)

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

Instance Method Details

#fetchFleetInstance

Fetch the FleetInstance

Returns:


229
230
231
232
233
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 229

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

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

#inspectObject

Provide a detailed, user friendly representation


282
283
284
285
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 282

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

#to_sObject

Provide a user friendly representation


275
276
277
278
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 275

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) ⇒ FleetInstance

Update the FleetInstance

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.

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

    The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.

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

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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

    A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

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

    The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

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

    A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

Returns:


258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/twilio-ruby/rest/supersim/v1/fleet.rb', line 258

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 = 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,
  })

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

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