class Twilio::REST::Supersim::V1::FleetContext
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the FleetContext
@param [Version] version Version
that contains the resource @param [String] sid The SID of the Fleet resource to fetch. @return [FleetContext] FleetContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/supersim/v1/fleet.rb 222 def initialize(version, sid) 223 super(version) 224 225 # Path Solution 226 @solution = {sid: sid, } 227 @uri = "/Fleets/#{@solution[:sid]}" 228 end
Public Instance Methods
Fetch the FleetInstance
@return [FleetInstance] Fetched FleetInstance
# File lib/twilio-ruby/rest/supersim/v1/fleet.rb 233 def fetch 234 payload = @version.fetch('GET', @uri) 235 236 FleetInstance.new(@version, payload, sid: @solution[:sid], ) 237 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/supersim/v1/fleet.rb 286 def inspect 287 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 288 "#<Twilio.Supersim.V1.FleetContext #{context}>" 289 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/supersim/v1/fleet.rb 279 def to_s 280 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 281 "#<Twilio.Supersim.V1.FleetContext #{context}>" 282 end
Update the FleetInstance
@param [String] unique_name 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.
@param [String] network_access_profile The SID or unique name of the Network
Access Profile that will control which cellular networks the Fleet's SIMs can connect to.
@param [String] commands_url 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 Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
@param [String] commands_method A string representing the HTTP
method to use
when making a request to `commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
@param [String] sms_commands_url 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.
@param [String] sms_commands_method 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`.
@return [FleetInstance] Updated FleetInstance
# File lib/twilio-ruby/rest/supersim/v1/fleet.rb 262 def update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset) 263 data = Twilio::Values.of({ 264 'UniqueName' => unique_name, 265 'NetworkAccessProfile' => network_access_profile, 266 'CommandsUrl' => commands_url, 267 'CommandsMethod' => commands_method, 268 'SmsCommandsUrl' => sms_commands_url, 269 'SmsCommandsMethod' => sms_commands_method, 270 }) 271 272 payload = @version.update('POST', @uri, data: data) 273 274 FleetInstance.new(@version, payload, sid: @solution[:sid], ) 275 end