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, CustomerProfilesChannelEndpointAssignmentList, CustomerProfilesChannelEndpointAssignmentPage, CustomerProfilesEntityAssignmentsContext, CustomerProfilesEntityAssignmentsInstance, CustomerProfilesEntityAssignmentsList, CustomerProfilesEntityAssignmentsPage, CustomerProfilesEvaluationsContext, CustomerProfilesEvaluationsInstance, CustomerProfilesEvaluationsList, CustomerProfilesEvaluationsPage

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.



178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 178

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)


244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 244

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)


263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 263

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)


282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 282

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



193
194
195
196
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 193

def delete

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

#fetchCustomerProfilesInstance

Fetch the CustomerProfilesInstance

Returns:



201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 201

def fetch

    payload = @version.fetch('GET', @uri)
    CustomerProfilesInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



300
301
302
303
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 300

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:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb', line 218

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,
    })

    payload = @version.update('POST', @uri, data: data)
    CustomerProfilesInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end