Class: Twilio::REST::Trusthub::V1::CustomerProfilesContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb,
lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb,
lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb,
lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb

Defined Under Namespace

Classes: CustomerProfilesChannelEndpointAssignmentContext, CustomerProfilesChannelEndpointAssignmentInstance, CustomerProfilesChannelEndpointAssignmentInstanceMetadata, CustomerProfilesChannelEndpointAssignmentList, CustomerProfilesChannelEndpointAssignmentListResponse, CustomerProfilesChannelEndpointAssignmentPage, CustomerProfilesChannelEndpointAssignmentPageMetadata, CustomerProfilesEntityAssignmentsContext, CustomerProfilesEntityAssignmentsInstance, CustomerProfilesEntityAssignmentsInstanceMetadata, CustomerProfilesEntityAssignmentsList, CustomerProfilesEntityAssignmentsListResponse, CustomerProfilesEntityAssignmentsPage, CustomerProfilesEntityAssignmentsPageMetadata, CustomerProfilesEvaluationsContext, CustomerProfilesEvaluationsInstance, CustomerProfilesEvaluationsInstanceMetadata, CustomerProfilesEvaluationsList, CustomerProfilesEvaluationsListResponse, CustomerProfilesEvaluationsPage, CustomerProfilesEvaluationsPageMetadata

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ CustomerProfilesContext

Initialize the CustomerProfilesContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

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



257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 257

def initialize(version, sid)
    super(version)
    

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/CustomerProfiles/#{@solution[:sid]}"

    # Dependents
    @customer_profiles_channel_endpoint_assignment = nil
    @customer_profiles_entity_assignments = nil
    @customer_profiles_evaluations = nil
end

Instance Method Details

#customer_profiles_channel_endpoint_assignment(sid = :unset) ⇒ CustomerProfilesChannelEndpointAssignmentList, CustomerProfilesChannelEndpointAssignmentContext

Access the customer_profiles_channel_endpoint_assignment

Returns:

Raises:

  • (ArgumentError)


426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 426

def customer_profiles_channel_endpoint_assignment(sid=:unset)

    raise ArgumentError, 'sid cannot be nil' if sid.nil?

    if sid != :unset
        return CustomerProfilesChannelEndpointAssignmentContext.new(@version, @solution[:sid],sid )
    end

    unless @customer_profiles_channel_endpoint_assignment
        @customer_profiles_channel_endpoint_assignment = CustomerProfilesChannelEndpointAssignmentList.new(
            @version, customer_profile_sid: @solution[:sid], )
    end

 @customer_profiles_channel_endpoint_assignment
end

#customer_profiles_entity_assignments(sid = :unset) ⇒ CustomerProfilesEntityAssignmentsList, CustomerProfilesEntityAssignmentsContext

Access the customer_profiles_entity_assignments

Returns:

Raises:

  • (ArgumentError)


445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 445

def customer_profiles_entity_assignments(sid=:unset)

    raise ArgumentError, 'sid cannot be nil' if sid.nil?

    if sid != :unset
        return CustomerProfilesEntityAssignmentsContext.new(@version, @solution[:sid],sid )
    end

    unless @customer_profiles_entity_assignments
        @customer_profiles_entity_assignments = CustomerProfilesEntityAssignmentsList.new(
            @version, customer_profile_sid: @solution[:sid], )
    end

 @customer_profiles_entity_assignments
end

#customer_profiles_evaluations(sid = :unset) ⇒ CustomerProfilesEvaluationsList, CustomerProfilesEvaluationsContext

Access the customer_profiles_evaluations

Returns:

Raises:

  • (ArgumentError)


464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 464

def customer_profiles_evaluations(sid=:unset)

    raise ArgumentError, 'sid cannot be nil' if sid.nil?

    if sid != :unset
        return CustomerProfilesEvaluationsContext.new(@version, @solution[:sid],sid )
    end

    unless @customer_profiles_evaluations
        @customer_profiles_evaluations = CustomerProfilesEvaluationsList.new(
            @version, customer_profile_sid: @solution[:sid], )
    end

 @customer_profiles_evaluations
end

#deleteBoolean

Delete the CustomerProfilesInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



273
274
275
276
277
278
279
280
281
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 273

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the CustomerProfilesInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 286

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      customerProfiles_instance = CustomerProfilesInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, customerProfiles_instance, response.headers, response.status_code)
end

#fetchCustomerProfilesInstance

Fetch the CustomerProfilesInstance

Returns:



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 305

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    CustomerProfilesInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#fetch_with_metadataCustomerProfilesInstance

Fetch the CustomerProfilesInstanceMetadata

Returns:



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 324

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    customer_profiles_instance = CustomerProfilesInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        customer_profiles_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



489
490
491
492
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 489

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Trusthub.V1.CustomerProfilesContext #{context}>"
end

#to_sObject

Provide a user friendly representation



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

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Trusthub.V1.CustomerProfilesContext #{context}>"
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:



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

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

    data = Twilio::Values.of({
        'Status' => status,
        'StatusCallback' => status_callback,
        'FriendlyName' => friendly_name,
        'Email' => email,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    CustomerProfilesInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

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

Update the CustomerProfilesInstanceMetadata

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:



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 388

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

    data = Twilio::Values.of({
        'Status' => status,
        'StatusCallback' => status_callback,
        'FriendlyName' => friendly_name,
        'Email' => email,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    customer_profiles_instance = CustomerProfilesInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        customer_profiles_instance,
        response.headers,
        response.status_code
    )
end