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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, customer_profile_sid, sid) ⇒ CustomerProfilesEntityAssignmentsContext

Initialize the CustomerProfilesEntityAssignmentsContext

Parameters:

  • Version that contains the resource

  • The unique string that we created to identify the CustomerProfile resource.

  • The unique string that we created to identify the Identity resource.



228
229
230
231
232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 228

def initialize(version, customer_profile_sid, sid)
    super(version)
    

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

    
end

Instance Method Details

#deleteBoolean

Delete the CustomerProfilesEntityAssignmentsInstance

Returns:

  • True if delete succeeds, false otherwise



241
242
243
244
245
246
247
248
249
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 241

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 CustomerProfilesEntityAssignmentsInstanceMetadata

Returns:

  • True if delete succeeds, false otherwise



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

def 

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

#fetchCustomerProfilesEntityAssignmentsInstance

Fetch the CustomerProfilesEntityAssignmentsInstance

Returns:

  • Fetched CustomerProfilesEntityAssignmentsInstance



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 273

def fetch

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

#fetch_with_metadataCustomerProfilesEntityAssignmentsInstance

Fetch the CustomerProfilesEntityAssignmentsInstanceMetadata

Returns:

  • Fetched CustomerProfilesEntityAssignmentsInstance



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 293

def 

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

#inspectObject

Provide a detailed, user friendly representation



326
327
328
329
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 326

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

#to_sObject

Provide a user friendly representation



319
320
321
322
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 319

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