Class: Twilio::REST::Preview::DeployedDevices::FleetContext::DeploymentContext

Inherits:
InstanceContext
  • Object
show all
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

Constructor Details

#initialize(version, fleet_sid, sid) ⇒ DeploymentContext

Initialize the DeploymentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • fleet_sid (String)

    The fleet_sid

  • sid (String)

    Provides a 34 character string that uniquely identifies the requested Deployment resource.



182
183
184
185
186
187
188
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 182

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

#deleteBoolean

Deletes the DeploymentInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



208
209
210
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 208

def delete
  @version.delete('delete', @uri)
end

#fetchDeploymentInstance

Fetch a DeploymentInstance

Returns:



193
194
195
196
197
198
199
200
201
202
203
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 193

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

#inspectObject

Provide a detailed, user friendly representation



241
242
243
244
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 241

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

#to_sObject

Provide a user friendly representation



234
235
236
237
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 234

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

Parameters:

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

    Provides a human readable descriptive text for this Deployment, up to 64 characters long

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

    Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment.

Returns:



220
221
222
223
224
225
226
227
228
229
230
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 220

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