Class: Twilio::REST::Memory::V1::TraitGroupList::ValidationRule

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) ⇒ ValidationRule

Returns a new instance of ValidationRule.



86
87
88
89
90
91
92
93
94
95
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 86

def initialize(payload)
        @pattern = payload["pattern"]
        @min_length = payload["min_length"]
        @max_length = payload["max_length"]
        @rule_type = payload["rule_type"]
        @min = payload["min"]
        @max = payload["max"]
        @min_items = payload["min_items"]
        @max_items = payload["max_items"]
end

Instance Attribute Details

#maxObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def max
  @max
end

#max_itemsObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def max_items
  @max_items
end

#max_lengthObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def max_length
  @max_length
end

#minObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def min
  @min
end

#min_itemsObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def min_items
  @min_items
end

#min_lengthObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def min_length
  @min_length
end

#patternObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def pattern
  @pattern
end

#rule_typeObject

Parameters:

  • : (pattern)
    String

    Regex pattern (max 1000 chars)

  • : (min_length)
    Integer

    Minimum string length

  • : (max_length)
    Integer

    Maximum string length

  • : (rule_type)
    String

    Discriminator field indicating this is an array validation rule.

  • : (min)
    Float

    Minimum value

  • : (max)
    Float

    Maximum value

  • : (min_items)
    Integer

    Minimum number of items

  • : (max_items)
    Integer

    Maximum number of items



85
86
87
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 85

def rule_type
  @rule_type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 96

def to_json(options = {})
{
        "pattern": @pattern,
        "minLength": @min_length,
        "maxLength": @max_length,
        "ruleType": @rule_type,
        "min": @min,
        "max": @max,
        "minItems": @min_items,
        "maxItems": @max_items,
}.to_json(options)
end