class Twilio::REST::Chat::V1::ServiceContext::ChannelContext::InviteInstance
Public Class Methods
Initialize the InviteInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the
{Service}[https://www.twilio.com/docs/api/chat/rest/services] the resource is associated with.
@param [String] channel_sid
The SID of the
{Channel}[https://www.twilio.com/docs/api/chat/rest/channels] the resource belongs to.
@param [String] sid The Twilio-provided string that uniquely identifies the
Invite resource to fetch.
@return [InviteInstance] InviteInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 267 def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) 268 super(version) 269 270 # Marshaled Properties 271 @properties = { 272 'sid' => payload['sid'], 273 'account_sid' => payload['account_sid'], 274 'channel_sid' => payload['channel_sid'], 275 'service_sid' => payload['service_sid'], 276 'identity' => payload['identity'], 277 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 278 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 279 'role_sid' => payload['role_sid'], 280 'created_by' => payload['created_by'], 281 'url' => payload['url'], 282 } 283 284 # Context 285 @instance_context = nil 286 @params = { 287 'service_sid' => service_sid, 288 'channel_sid' => channel_sid, 289 'sid' => sid || @properties['sid'], 290 } 291 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 317 def account_sid 318 @properties['account_sid'] 319 end
@return [String] The SID of the Channel the new resource belongs to
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 323 def channel_sid 324 @properties['channel_sid'] 325 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [InviteContext] InviteContext
for this InviteInstance
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 297 def context 298 unless @instance_context 299 @instance_context = InviteContext.new( 300 @version, 301 @params['service_sid'], 302 @params['channel_sid'], 303 @params['sid'], 304 ) 305 end 306 @instance_context 307 end
@return [String] The identity of the User that created the invite
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 359 def created_by 360 @properties['created_by'] 361 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 341 def date_created 342 @properties['date_created'] 343 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 347 def date_updated 348 @properties['date_updated'] 349 end
Delete the InviteInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 379 def delete 380 context.delete 381 end
Fetch the InviteInstance
@return [InviteInstance] Fetched InviteInstance
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 372 def fetch 373 context.fetch 374 end
@return [String] The string that identifies the resource's User
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 335 def identity 336 @properties['identity'] 337 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 392 def inspect 393 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 394 "<Twilio.Chat.V1.InviteInstance #{values}>" 395 end
@return [String] The SID of the Role assigned to the member
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 353 def role_sid 354 @properties['role_sid'] 355 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 329 def service_sid 330 @properties['service_sid'] 331 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 311 def sid 312 @properties['sid'] 313 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 385 def to_s 386 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 387 "<Twilio.Chat.V1.InviteInstance #{values}>" 388 end
@return [String] The absolute URL of the Invite resource
# File lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb 365 def url 366 @properties['url'] 367 end