class Twilio::REST::Preview::DeployedDevices::FleetContext

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, sid) click to toggle source

Initialize the FleetContext @param [Version] version Version that contains the resource @param [String] sid Provides a 34 character string that uniquely identifies the

requested Fleet resource.

@return [FleetContext] FleetContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
168 def initialize(version, sid)
169   super(version)
170 
171   # Path Solution
172   @solution = {sid: sid, }
173   @uri = "/Fleets/#{@solution[:sid]}"
174 
175   # Dependents
176   @devices = nil
177   @deployments = nil
178   @certificates = nil
179   @keys = nil
180 end

Public Instance Methods

certificates(sid=:unset) click to toggle source

Access the certificates @return [CertificateList] @return [CertificateContext] if sid was passed.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
256 def certificates(sid=:unset)
257   raise ArgumentError, 'sid cannot be nil' if sid.nil?
258 
259   if sid != :unset
260     return CertificateContext.new(@version, @solution[:sid], sid, )
261   end
262 
263   unless @certificates
264     @certificates = CertificateList.new(@version, fleet_sid: @solution[:sid], )
265   end
266 
267   @certificates
268 end
delete() click to toggle source

Delete the FleetInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
194 def delete
195    @version.delete('DELETE', @uri)
196 end
deployments(sid=:unset) click to toggle source

Access the deployments @return [DeploymentList] @return [DeploymentContext] if sid was passed.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
238 def deployments(sid=:unset)
239   raise ArgumentError, 'sid cannot be nil' if sid.nil?
240 
241   if sid != :unset
242     return DeploymentContext.new(@version, @solution[:sid], sid, )
243   end
244 
245   unless @deployments
246     @deployments = DeploymentList.new(@version, fleet_sid: @solution[:sid], )
247   end
248 
249   @deployments
250 end
devices(sid=:unset) click to toggle source

Access the devices @return [DeviceList] @return [DeviceContext] if sid was passed.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
220 def devices(sid=:unset)
221   raise ArgumentError, 'sid cannot be nil' if sid.nil?
222 
223   if sid != :unset
224     return DeviceContext.new(@version, @solution[:sid], sid, )
225   end
226 
227   unless @devices
228     @devices = DeviceList.new(@version, fleet_sid: @solution[:sid], )
229   end
230 
231   @devices
232 end
fetch() click to toggle source

Fetch the FleetInstance @return [FleetInstance] Fetched FleetInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
185 def fetch
186   payload = @version.fetch('GET', @uri)
187 
188   FleetInstance.new(@version, payload, sid: @solution[:sid], )
189 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
297 def inspect
298   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
299   "#<Twilio.Preview.DeployedDevices.FleetContext #{context}>"
300 end
keys(sid=:unset) click to toggle source

Access the keys @return [KeyList] @return [KeyContext] if sid was passed.

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
274 def keys(sid=:unset)
275   raise ArgumentError, 'sid cannot be nil' if sid.nil?
276 
277   if sid != :unset
278     return KeyContext.new(@version, @solution[:sid], sid, )
279   end
280 
281   unless @keys
282     @keys = KeyList.new(@version, fleet_sid: @solution[:sid], )
283   end
284 
285   @keys
286 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
290 def to_s
291   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
292   "#<Twilio.Preview.DeployedDevices.FleetContext #{context}>"
293 end
update(friendly_name: :unset, default_deployment_sid: :unset) click to toggle source

Update the FleetInstance @param [String] friendly_name Provides a human readable descriptive text for

this Fleet, up to 256 characters long.

@param [String] default_deployment_sid Provides a string identifier of a

Deployment that is going to be used as a default one for this Fleet.

@return [FleetInstance] Updated FleetInstance

    # File lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb
205 def update(friendly_name: :unset, default_deployment_sid: :unset)
206   data = Twilio::Values.of({
207       'FriendlyName' => friendly_name,
208       'DefaultDeploymentSid' => default_deployment_sid,
209   })
210 
211   payload = @version.update('POST', @uri, data: data)
212 
213   FleetInstance.new(@version, payload, sid: @solution[:sid], )
214 end