Class: Twilio::REST::Trusthub::V1::CustomerProfilesInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the CustomerProfilesInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 377

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 Customer-Profile resource.

Returns:



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

def 
    @properties['account_sid']
end

#contextCustomerProfilesContext

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

Returns:



406
407
408
409
410
411
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 406

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

#customer_profiles_channel_endpoint_assignmentcustomer_profiles_channel_endpoint_assignment

Access the customer_profiles_channel_endpoint_assignment

Returns:



532
533
534
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 532

def customer_profiles_channel_endpoint_assignment
    context.customer_profiles_channel_endpoint_assignment
end

#customer_profiles_entity_assignmentscustomer_profiles_entity_assignments

Access the customer_profiles_entity_assignments

Returns:



539
540
541
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 539

def customer_profiles_entity_assignments
    context.customer_profiles_entity_assignments
end

#customer_profiles_evaluationscustomer_profiles_evaluations

Access the customer_profiles_evaluations

Returns:



546
547
548
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 546

def customer_profiles_evaluations
    context.customer_profiles_evaluations
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:



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

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:



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the CustomerProfilesInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



494
495
496
497
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 494

def delete

    context.delete
end

#emailString

Returns The email address that will receive updates when the Customer-Profile resource changes status.

Returns:

  • (String)

    The email address that will receive updates when the Customer-Profile resource changes status.



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

def email
    @properties['email']
end

#errorsArray<Hash>

Returns The error codes associated with the rejection of the Customer-Profile.

Returns:

  • (Array<Hash>)

    The error codes associated with the rejection of the Customer-Profile.



487
488
489
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 487

def errors
    @properties['errors']
end

#fetchCustomerProfilesInstance

Fetch the CustomerProfilesInstance

Returns:



502
503
504
505
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 502

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.



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

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



559
560
561
562
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 559

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

Returns The URLs of the Assigned Items of the Customer-Profile resource.

Returns:

  • (Hash)

    The URLs of the Assigned Items of the Customer-Profile resource.



481
482
483
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 481

def links
    @properties['links']
end

#policy_sidString

Returns The unique string of a policy that is associated to the Customer-Profile resource.

Returns:

  • (String)

    The unique string of a policy that is associated to the Customer-Profile resource.



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

def policy_sid
    @properties['policy_sid']
end

#sidString

Returns The unique string that we created to identify the Customer-Profile resource.

Returns:

  • (String)

    The unique string that we created to identify the Customer-Profile resource.



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

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


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

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.



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

def status_callback
    @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



552
553
554
555
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 552

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

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

Update the CustomerProfilesInstance

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 Customer-Profile resource changes status.

Returns:



514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 514

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 Customer-Profile resource.

Returns:

  • (String)

    The absolute URL of the Customer-Profile resource.



475
476
477
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 475

def url
    @properties['url']
end

#valid_untilTime

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

Returns:



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

def valid_until
    @properties['valid_until']
end