class Twilio::REST::Chat::V2::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/chat/rest/service-resource] the Invite resource is associated with.
@param [String] channel_sid
The SID of the
{Channel}[https://www.twilio.com/docs/chat/channels] the Invite resource belongs to.
@param [String] sid The SID of the Invite resource to fetch. @return [InviteInstance] InviteInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 262 def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) 263 super(version) 264 265 # Marshaled Properties 266 @properties = { 267 'sid' => payload['sid'], 268 'account_sid' => payload['account_sid'], 269 'channel_sid' => payload['channel_sid'], 270 'service_sid' => payload['service_sid'], 271 'identity' => payload['identity'], 272 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 273 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 274 'role_sid' => payload['role_sid'], 275 'created_by' => payload['created_by'], 276 'url' => payload['url'], 277 } 278 279 # Context 280 @instance_context = nil 281 @params = { 282 'service_sid' => service_sid, 283 'channel_sid' => channel_sid, 284 'sid' => sid || @properties['sid'], 285 } 286 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 312 def account_sid 313 @properties['account_sid'] 314 end
@return [String] The SID of the Channel the new resource belongs to
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 318 def channel_sid 319 @properties['channel_sid'] 320 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/v2/service/channel/invite.rb 292 def context 293 unless @instance_context 294 @instance_context = InviteContext.new( 295 @version, 296 @params['service_sid'], 297 @params['channel_sid'], 298 @params['sid'], 299 ) 300 end 301 @instance_context 302 end
@return [String] The identity of the User that created the invite
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 354 def created_by 355 @properties['created_by'] 356 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 336 def date_created 337 @properties['date_created'] 338 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 342 def date_updated 343 @properties['date_updated'] 344 end
Delete the InviteInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 374 def delete 375 context.delete 376 end
Fetch the InviteInstance
@return [InviteInstance] Fetched InviteInstance
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 367 def fetch 368 context.fetch 369 end
@return [String] The string that identifies the resource's User
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 330 def identity 331 @properties['identity'] 332 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 387 def inspect 388 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 389 "<Twilio.Chat.V2.InviteInstance #{values}>" 390 end
@return [String] The SID of the Role assigned to the member
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 348 def role_sid 349 @properties['role_sid'] 350 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 324 def service_sid 325 @properties['service_sid'] 326 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 306 def sid 307 @properties['sid'] 308 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 380 def to_s 381 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 382 "<Twilio.Chat.V2.InviteInstance #{values}>" 383 end
@return [String] The absolute URL of the Invite resource
# File lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb 360 def url 361 @properties['url'] 362 end