Class: Twilio::REST::Memory::V1::TraitGroupList::TraitDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/memory/v1/trait_group.rb,
lib/twilio-ruby/rest/memory/v1/trait_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ TraitDefinition

Returns a new instance of TraitDefinition.



44
45
46
47
48
49
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 44

def initialize(payload)
        @data_type = payload["data_type"]
        @description = payload["description"]
        @validation_rule = payload["validation_rule"]
        @id_type_promotion = payload["id_type_promotion"]
end

Instance Attribute Details

#data_typeObject

Parameters:

  • : (data_type)

    [String] Data type of the Trait, such as STRING, NUMBER, BOOLEAN, ARRAY. For DELETE operations in PATCH requests, set this to an empty string ("") to mark the trait for deletion.

  • : (description)

    [String] Description of the Trait, providing additional context or information.

  • : (validation_rule)

    [ValidationRule]

  • : (id_type_promotion)

    [String] The name of the identifier type to promote the trait value to, such as ''email'', ''phone'', ''user_id'', etc. This allows the trait to be mapped to an identifier in Identity Resolution. The identifier type should be configured in the Identity Resolution Settings.



43
44
45
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 43

def data_type
  @data_type
end

#descriptionObject

Parameters:

  • : (data_type)

    [String] Data type of the Trait, such as STRING, NUMBER, BOOLEAN, ARRAY. For DELETE operations in PATCH requests, set this to an empty string ("") to mark the trait for deletion.

  • : (description)

    [String] Description of the Trait, providing additional context or information.

  • : (validation_rule)

    [ValidationRule]

  • : (id_type_promotion)

    [String] The name of the identifier type to promote the trait value to, such as ''email'', ''phone'', ''user_id'', etc. This allows the trait to be mapped to an identifier in Identity Resolution. The identifier type should be configured in the Identity Resolution Settings.



43
44
45
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 43

def description
  @description
end

#id_type_promotionObject

Parameters:

  • : (data_type)

    [String] Data type of the Trait, such as STRING, NUMBER, BOOLEAN, ARRAY. For DELETE operations in PATCH requests, set this to an empty string ("") to mark the trait for deletion.

  • : (description)

    [String] Description of the Trait, providing additional context or information.

  • : (validation_rule)

    [ValidationRule]

  • : (id_type_promotion)

    [String] The name of the identifier type to promote the trait value to, such as ''email'', ''phone'', ''user_id'', etc. This allows the trait to be mapped to an identifier in Identity Resolution. The identifier type should be configured in the Identity Resolution Settings.



43
44
45
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 43

def id_type_promotion
  @id_type_promotion
end

#validation_ruleObject

Parameters:

  • : (data_type)

    [String] Data type of the Trait, such as STRING, NUMBER, BOOLEAN, ARRAY. For DELETE operations in PATCH requests, set this to an empty string ("") to mark the trait for deletion.

  • : (description)

    [String] Description of the Trait, providing additional context or information.

  • : (validation_rule)

    [ValidationRule]

  • : (id_type_promotion)

    [String] The name of the identifier type to promote the trait value to, such as ''email'', ''phone'', ''user_id'', etc. This allows the trait to be mapped to an identifier in Identity Resolution. The identifier type should be configured in the Identity Resolution Settings.



43
44
45
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 43

def validation_rule
  @validation_rule
end

Instance Method Details

#to_json(options = {}) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 50

def to_json(options = {})
{
        "dataType": @data_type,
        "description": @description,
        "validationRule": @validation_rule,
        "idTypePromotion": @id_type_promotion,
}.to_json(options)
end