Class: Twilio::REST::Preview::DeployedDevices::FleetContext::DeploymentContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::DeployedDevices::FleetContext::DeploymentContext
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb
Overview
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 [email protected].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the DeploymentInstance.
-
#fetch ⇒ DeploymentInstance
Fetch a DeploymentInstance.
-
#initialize(version, fleet_sid, sid) ⇒ DeploymentContext
constructor
Initialize the DeploymentContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, sync_service_sid: :unset) ⇒ DeploymentInstance
Update the DeploymentInstance.
Constructor Details
#initialize(version, fleet_sid, sid) ⇒ DeploymentContext
Initialize the DeploymentContext
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 200 def initialize(version, fleet_sid, sid) super(version) # Path Solution @solution = { fleet_sid: fleet_sid, sid: sid, } @uri = "/Fleets/#{@solution[:fleet_sid]}/Deployments/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the DeploymentInstance
234 235 236 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 234 def delete @version.delete('delete', @uri) end |
#fetch ⇒ DeploymentInstance
Fetch a DeploymentInstance
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 214 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) DeploymentInstance.new( @version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
268 269 270 271 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 268 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.DeployedDevices.DeploymentContext #{context}>" end |
#update(friendly_name: :unset, sync_service_sid: :unset) ⇒ DeploymentInstance
Update the DeploymentInstance
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 246 def update(friendly_name: :unset, sync_service_sid: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'SyncServiceSid' => sync_service_sid, }) payload = @version.update( 'POST', @uri, data: data, ) DeploymentInstance.new( @version, payload, fleet_sid: @solution[:fleet_sid], sid: @solution[:sid], ) end |