Class: Twilio::REST::Trusthub::V1::TrustProductsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ TrustProductsInstance

Initialize the TrustProductsInstance

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 TrustProducts resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 360

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'policy_sid' => payload['policy_sid'],
        'friendly_name' => payload['friendly_name'],
        'status' => payload['status'],
        'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
        'email' => payload['email'],
        'status_callback' => payload['status_callback'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
        'errors' => payload['errors'],
    }

    # Context
    @instance_context = nil
    @params = { '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 Trust Product resource.

Returns:



404
405
406
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 404

def 
    @properties['account_sid']
end

#contextTrustProductsContext

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

Returns:



389
390
391
392
393
394
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 389

def context
    unless @instance_context
        @instance_context = TrustProductsContext.new(@version , @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:



446
447
448
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 446

def date_created
    @properties['date_created']
end

#date_updatedTime

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

Returns:



452
453
454
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 452

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the TrustProductsInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



477
478
479
480
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 477

def delete

    context.delete
end

#emailString

Returns The email address that will receive updates when the Trust Product resource changes status.

Returns:

  • (String)

    The email address that will receive updates when the Trust Product resource changes status.



434
435
436
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 434

def email
    @properties['email']
end

#errorsArray<Hash>

Returns The error codes associated with the rejection of the Trust Product.

Returns:

  • (Array<Hash>)

    The error codes associated with the rejection of the Trust Product.



470
471
472
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 470

def errors
    @properties['errors']
end

#fetchTrustProductsInstance

Fetch the TrustProductsInstance

Returns:



485
486
487
488
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 485

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



416
417
418
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 416

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



542
543
544
545
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 542

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

Returns The URLs of the Assigned Items of the Trust Product resource.

Returns:

  • (Hash)

    The URLs of the Assigned Items of the Trust Product resource.



464
465
466
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 464

def links
    @properties['links']
end

#policy_sidString

Returns The unique string of the policy that is associated with the Trust Product resource.

Returns:

  • (String)

    The unique string of the policy that is associated with the Trust Product resource.



410
411
412
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 410

def policy_sid
    @properties['policy_sid']
end

#sidString

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

Returns:

  • (String)

    The unique string that we created to identify the Trust Product resource.



398
399
400
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 398

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


422
423
424
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 422

def status
    @properties['status']
end

#status_callbackString

Returns The URL we call to inform your application of status changes.

Returns:

  • (String)

    The URL we call to inform your application of status changes.



440
441
442
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 440

def status_callback
    @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



535
536
537
538
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 535

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

#trust_products_channel_endpoint_assignmenttrust_products_channel_endpoint_assignment

Access the trust_products_channel_endpoint_assignment

Returns:



515
516
517
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 515

def trust_products_channel_endpoint_assignment
    context.trust_products_channel_endpoint_assignment
end

#trust_products_entity_assignmentstrust_products_entity_assignments

Access the trust_products_entity_assignments

Returns:



522
523
524
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 522

def trust_products_entity_assignments
    context.trust_products_entity_assignments
end

#trust_products_evaluationstrust_products_evaluations

Access the trust_products_evaluations

Returns:



529
530
531
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 529

def trust_products_evaluations
    context.trust_products_evaluations
end

#update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ TrustProductsInstance

Update the TrustProductsInstance

Parameters:

  • status (Status) (defaults to: :unset)
  • status_callback (String) (defaults to: :unset)

    The URL we call to inform your application of status changes.

  • friendly_name (String) (defaults to: :unset)

    The string that you assigned to describe the resource.

  • email (String) (defaults to: :unset)

    The email address that will receive updates when the Trust Product resource changes status.

Returns:



497
498
499
500
501
502
503
504
505
506
507
508
509
510
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 497

def update(
    status: :unset, 
    status_callback: :unset, 
    friendly_name: :unset, 
    email: :unset
)

    context.update(
        status: status, 
        status_callback: status_callback, 
        friendly_name: friendly_name, 
        email: email, 
    )
end

#urlString

Returns The absolute URL of the Trust Product resource.

Returns:

  • (String)

    The absolute URL of the Trust Product resource.



458
459
460
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 458

def url
    @properties['url']
end

#valid_untilTime

Returns The date and time in GMT in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format until which the resource will be valid.

Returns:



428
429
430
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 428

def valid_until
    @properties['valid_until']
end