lib/purecloud/models/condition.rb in purecloud-0.38.1 vs lib/purecloud/models/condition.rb in purecloud-0.39.1

- old
+ new

@@ -16,22 +16,29 @@ require 'date' module PureCloud class Condition + # The type of the condition attr_accessor :type + # Indicates whether to evaluate for the opposite of the stated condition; default is false attr_accessor :inverted + # An attribute name associated with the condition (applies only to certain rule conditions) attr_accessor :attribute_name + # A value associated with the condition attr_accessor :value + # Determines the type of the value associated with the condition attr_accessor :value_type + # An operation type for condition evaluation attr_accessor :operator + # List of wrap-up code identifiers (used only in conditions of type 'wrapupCondition') attr_accessor :codes # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -104,9 +111,18 @@ if (value = attributes[:'codes']).is_a?(Array) self.codes = value end end + end + + # Custom attribute writer method checking allowed values (enum). + def type=(type) + allowed_values = ["wrapupCondition", "contactAttributeCondition", "phoneNumberCondition", "phoneNumberTypeCondition", "callAnalysisCondition"] + if type && !allowed_values.include?(type) + fail "invalid value for 'type', must be one of #{allowed_values}" + end + @type = type end # Custom attribute writer method checking allowed values (enum). def value_type=(value_type) allowed_values = ["STRING", "NUMERIC", "DATETIME", "PERIOD"]