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



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 356

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'],
    }

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

Instance Method Details

#account_sidString



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

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



384
385
386
387
388
389
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 384

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



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

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



511
512
513
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 511

def customer_profiles_entity_assignments
    context.customer_profiles_entity_assignments
end

#customer_profiles_evaluationscustomer_profiles_evaluations

Access the customer_profiles_evaluations



518
519
520
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 518

def customer_profiles_evaluations
    context.customer_profiles_evaluations
end

#date_createdTime



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

def date_created
    @properties['date_created']
end

#date_updatedTime



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the CustomerProfilesInstance



466
467
468
469
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 466

def delete

    context.delete
end

#emailString



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

def email
    @properties['email']
end

#fetchCustomerProfilesInstance

Fetch the CustomerProfilesInstance



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

def fetch

    context.fetch
end

#friendly_nameString



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

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



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

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


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

def links
    @properties['links']
end

#policy_sidString



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

def policy_sid
    @properties['policy_sid']
end

#sidString



393
394
395
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 393

def sid
    @properties['sid']
end

#statusStatus



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

def status
    @properties['status']
end

#status_callbackString



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

def status_callback
    @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



524
525
526
527
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 524

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



486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 486

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



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

def url
    @properties['url']
end

#valid_untilTime



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

def valid_until
    @properties['valid_until']
end