Class: Twilio::REST::Messaging::V1::ServiceContext::ChannelSenderContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, messaging_service_sid, sid) ⇒ ChannelSenderContext

Initialize the ChannelSenderContext



220
221
222
223
224
225
226
227
228
229
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 220

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

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

    
end

Instance Method Details

#deleteBoolean

Delete the ChannelSenderInstance



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

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 ChannelSenderInstanceMetadata



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 246

def 

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

#fetchChannelSenderInstance

Fetch the ChannelSenderInstance



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 265

def fetch

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

#fetch_with_metadataChannelSenderInstance

Fetch the ChannelSenderInstanceMetadata



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 285

def 

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

#inspectObject

Provide a detailed, user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 318

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

#to_sObject

Provide a user friendly representation



311
312
313
314
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 311

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