Class: Twilio::REST::Messaging::V1::ServiceContext::DestinationAlphaSenderContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, sid) ⇒ DestinationAlphaSenderContext

Initialize the DestinationAlphaSenderContext

Parameters:



234
235
236
237
238
239
240
241
242
243
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 234

def initialize(version, service_sid, sid)
    super(version)
    

    # Path Solution
    @solution = { service_sid: service_sid, sid: sid,  }
    @uri = "/Services/#{@solution[:service_sid]}/DestinationAlphaSenders/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the DestinationAlphaSenderInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



247
248
249
250
251
252
253
254
255
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 247

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the DestinationAlphaSenderInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 260

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      destinationAlphaSender_instance = DestinationAlphaSenderInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, destinationAlphaSender_instance, response.headers, response.status_code)
end

#fetchDestinationAlphaSenderInstance

Fetch the DestinationAlphaSenderInstance

Returns:



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 279

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    DestinationAlphaSenderInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
        sid: @solution[:sid],
    )
end

#fetch_with_metadataDestinationAlphaSenderInstance

Fetch the DestinationAlphaSenderInstanceMetadata

Returns:



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 299

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    destination_alpha_sender_instance = DestinationAlphaSenderInstance.new(
        @version,
        response.body,
        service_sid: @solution[:service_sid],
        sid: @solution[:sid],
    )
    .new(
        @version,
        destination_alpha_sender_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



332
333
334
335
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 332

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

#to_sObject

Provide a user friendly representation



325
326
327
328
# File 'lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb', line 325

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