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

Inherits:
InstanceResource
  • 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, payload, customer_profile_sid: nil, sid: nil) ⇒ CustomerProfilesEntityAssignmentsInstance

Initialize the CustomerProfilesEntityAssignmentsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • customer_profile_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

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


229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 229

def initialize(version, payload, customer_profile_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'customer_profile_sid' => payload['customer_profile_sid'],
      'account_sid' => payload['account_sid'],
      'object_sid' => payload['object_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'url' => payload['url'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


276
277
278
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 276

def 
  @properties['account_sid']
end

#contextCustomerProfilesEntityAssignmentsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


251
252
253
254
255
256
257
258
259
260
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 251

def context
  unless @instance_context
    @instance_context = CustomerProfilesEntityAssignmentsContext.new(
        @version,
        @params['customer_profile_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#customer_profile_sidString

Returns The unique string that identifies the CustomerProfile resource.

Returns:

  • (String)

    The unique string that identifies the CustomerProfile resource.


270
271
272
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 270

def customer_profile_sid
  @properties['customer_profile_sid']
end

#date_createdTime

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was created


288
289
290
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 288

def date_created
  @properties['date_created']
end

#deleteBoolean

Delete the CustomerProfilesEntityAssignmentsInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
  context.delete
end

#fetchCustomerProfilesEntityAssignmentsInstance

Fetch the CustomerProfilesEntityAssignmentsInstance

Returns:


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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#object_sidString

Returns The sid of an object bag.

Returns:

  • (String)

    The sid of an object bag


282
283
284
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 282

def object_sid
  @properties['object_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


264
265
266
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 264

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


314
315
316
317
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 314

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

#urlString

Returns The absolute URL of the Identity resource.

Returns:

  • (String)

    The absolute URL of the Identity resource


294
295
296
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb', line 294

def url
  @properties['url']
end