Class: Twilio::REST::Trusthub::V1::TrustProductsContext::TrustProductsChannelEndpointAssignmentInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, trust_product_sid: nil, sid: nil) ⇒ TrustProductsChannelEndpointAssignmentInstance

Initialize the TrustProductsChannelEndpointAssignmentInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this TrustProductsChannelEndpointAssignment resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 258

def initialize(version, payload , trust_product_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'trust_product_sid' => payload['trust_product_sid'],
        'account_sid' => payload['account_sid'],
        'channel_endpoint_type' => payload['channel_endpoint_type'],
        'channel_endpoint_sid' => payload['channel_endpoint_sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'trust_product_sid' => trust_product_sid  || @properties['trust_product_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Item Assignment resource.

Returns:



302
303
304
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 302

def 
    @properties['account_sid']
end

#channel_endpoint_sidString

Returns The SID of an channel endpoint.

Returns:

  • (String)

    The SID of an channel endpoint



314
315
316
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 314

def channel_endpoint_sid
    @properties['channel_endpoint_sid']
end

#channel_endpoint_typeString

Returns The type of channel endpoint. eg: phone-number.

Returns:

  • (String)

    The type of channel endpoint. eg: phone-number



308
309
310
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 308

def channel_endpoint_type
    @properties['channel_endpoint_type']
end

#contextTrustProductsChannelEndpointAssignmentContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



281
282
283
284
285
286
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 281

def context
    unless @instance_context
        @instance_context = TrustProductsChannelEndpointAssignmentContext.new(@version , @params['trust_product_sid'], @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



320
321
322
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 320

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the TrustProductsChannelEndpointAssignmentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



333
334
335
336
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 333

def delete

    context.delete
end

#fetchTrustProductsChannelEndpointAssignmentInstance

Fetch the TrustProductsChannelEndpointAssignmentInstance

Returns:



341
342
343
344
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 341

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



355
356
357
358
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 355

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance #{values}>"
end

#sidString

Returns The unique string that we created to identify the Item Assignment resource.

Returns:

  • (String)

    The unique string that we created to identify the Item Assignment resource.



290
291
292
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 290

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



348
349
350
351
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 348

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance #{values}>"
end

#trust_product_sidString

Returns The unique string that we created to identify the CustomerProfile resource.

Returns:

  • (String)

    The unique string that we created to identify the CustomerProfile resource.



296
297
298
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 296

def trust_product_sid
    @properties['trust_product_sid']
end

#urlString

Returns The absolute URL of the Identity resource.

Returns:

  • (String)

    The absolute URL of the Identity resource.



326
327
328
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb', line 326

def url
    @properties['url']
end