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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, customer_profile_sid, sid) ⇒ CustomerProfilesChannelEndpointAssignmentContext

Initialize the CustomerProfilesChannelEndpointAssignmentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • customer_profile_sid (String)

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

  • sid (String)

    The unique string that we created to identify the resource.



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

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]}/ChannelEndpointAssignments/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the CustomerProfilesChannelEndpointAssignmentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



255
256
257
258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb', line 255

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 CustomerProfilesChannelEndpointAssignmentInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb', line 268

def 

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

#fetchCustomerProfilesChannelEndpointAssignmentInstance

Fetch the CustomerProfilesChannelEndpointAssignmentInstance

Returns:



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

def fetch

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

#fetch_with_metadataCustomerProfilesChannelEndpointAssignmentInstance

Fetch the CustomerProfilesChannelEndpointAssignmentInstanceMetadata

Returns:



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb', line 307

def 

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

#inspectObject

Provide a detailed, user friendly representation



340
341
342
343
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb', line 340

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

#to_sObject

Provide a user friendly representation



333
334
335
336
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb', line 333

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