Class: Twilio::REST::Chat::V2::ServiceContext::ChannelContext::InviteContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, channel_sid, sid) ⇒ InviteContext

Initialize the InviteContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The SID of the Service to fetch the Invite resource from.

  • channel_sid (String)

    The SID of the Channel the Invite resource to fetch belongs to. This value can be the Channel resource's `sid` or `unique_name`.

  • sid (String)

    The SID of the Invite resource to fetch.


204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb', line 204

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

  # Path Solution
  @solution = {service_sid: service_sid, channel_sid: channel_sid, sid: sid, }
  @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Invites/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the InviteInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


230
231
232
# File 'lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb', line 230

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

#fetchInviteInstance

Fetch the InviteInstance

Returns:


215
216
217
218
219
220
221
222
223
224
225
# File 'lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb', line 215

def fetch
  payload = @version.fetch('GET', @uri)

  InviteInstance.new(
      @version,
      payload,
      service_sid: @solution[:service_sid],
      channel_sid: @solution[:channel_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


243
244
245
246
# File 'lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb', line 243

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

#to_sObject

Provide a user friendly representation


236
237
238
239
# File 'lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb', line 236

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