Class: Twilio::REST::Memory::V1::TraitInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/trait.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, store_id: nil, profile_id: nil) ⇒ TraitInstance

Initialize the TraitInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Trait resource.

  • sid (String) —

    The SID of the Call resource to fetch.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 281

def initialize(version, payload , store_id: nil, profile_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'name' => payload['name'],
        'value' => payload['value'],
        'trait_group' => payload['trait_group'],
        'timestamp' => Twilio.deserialize_iso8601_datetime(payload['timestamp']),
        'source' => payload['source'],
    }
end

Instance Method Details

#inspect ⇒ Object

Provide a detailed, user friendly representation



335
336
337
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 335

def inspect
    "<Twilio.Memory.V1.TraitInstance>"
end

#name ⇒ String

Returns The name of the trait.

Returns:

  • (String) —

    The name of the trait.



299
300
301
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 299

def name
    @properties['name']
end

#source ⇒ String

Returns Caller-set, descriptive, untrusted provenance metadata. Must follow the company/product/Version#version/* convention. "twilio" is a reserved company name, only usable by authenticated internal callers.

Returns:

  • (String) —

    Caller-set, descriptive, untrusted provenance metadata. Must follow the company/product/Version#version/* convention. "twilio" is a reserved company name, only usable by authenticated internal callers.



323
324
325
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 323

def source
    @properties['source']
end

#timestamp ⇒ Time

Returns The time the trait was created or last updated.

Returns:

  • (Time) —

    The time the trait was created or last updated.



317
318
319
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 317

def timestamp
    @properties['timestamp']
end

#to_s ⇒ Object

Provide a user friendly representation



329
330
331
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 329

def to_s
    "<Twilio.Memory.V1.TraitInstance>"
end

#trait_group ⇒ String

Returns The trait group name to which this trait belongs.

Returns:

  • (String) —

    The trait group name to which this trait belongs.



311
312
313
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 311

def trait_group
    @properties['trait_group']
end

#value ⇒ Hash

Returns The value of a trait. Can be a string, integer, boolean, or an array of these types (arrays cannot contain nested arrays).

Returns:

  • (Hash) —

    The value of a trait. Can be a string, integer, boolean, or an array of these types (arrays cannot contain nested arrays).



305
306
307
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 305

def value
    @properties['value']
end