Custom attribute writer method checking allowed values (enum).
 @param [Object] form_text_field_type Object to be assigned
8055
def form_text_field_type=(form_text_field_type)
      validator = EnumAttributeValidator.new('String', ["AllTextTypes", "PlainText", "RichText"])
      if form_text_field_type.to_i == 0
        unless validator.valid?(form_text_field_type)
          raise ArgumentError, "invalid value for 'form_text_field_type', must be one of #{validator.allowable_values}."
        end
        @form_text_field_type = form_text_field_type
      else
        @form_text_field_type = validator.allowable_values[form_text_field_type.to_i]
      end
    end
418910
def type
      assert_exists
      value = @element.get_attribute("type").to_s

      # we return 'text' if the type is invalid
      # not sure if we really should do this
      TextFieldLocator::NON_TEXT_TYPES.include?(value) ? value : 'text'
    end
243666
def type=(type)
      validator = EnumAttributeValidator.new('String', ["PHYSICAL", "MOBILE"])
      unless validator.valid?(type)
        fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
      end
      @type = type
    end
134297
def product_type=(product_type)
      validator = EnumAttributeValidator.new('String', ["REGULAR", "GIFT_CARD", "APPOINTMENTS_SERVICE", "RETAIL_ITEM", "RESTAURANT_ITEM"])
      unless validator.valid?(product_type)
        fail ArgumentError, "invalid value for 'product_type', must be one of #{validator.allowable_values}."
      end
      @product_type = product_type
    end
819595
def ell_status=(ell_status)
      validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
      unless validator.valid?(ell_status)
        fail ArgumentError, "invalid value for 'ell_status', must be one of #{validator.allowable_values}."
      end
      @ell_status = ell_status
    end
94508
def text_repeat_type=(text_repeat_type)
      validator = EnumAttributeValidator.new('String', ["None", "FullTextRepeat", "RepeatWithTruncation"])
      if text_repeat_type.to_i == 0
        unless validator.valid?(text_repeat_type)
          raise ArgumentError, "invalid value for 'text_repeat_type', must be one of #{validator.allowable_values}."
        end
        @text_repeat_type = text_repeat_type
      else
        @text_repeat_type = validator.allowable_values[text_repeat_type.to_i]
      end
    end
595562
def inclusion_type=(inclusion_type)
      validator = EnumAttributeValidator.new('String', ["ADDITIVE", "INCLUSIVE"])
      unless validator.valid?(inclusion_type)
        fail ArgumentError, "invalid value for 'inclusion_type', must be one of #{validator.allowable_values}."
      end
      @inclusion_type = inclusion_type
    end
532688
def _setup_validation(self, sender, **kwargs):
        
        att_name = self.get_attname()
        private_att_name = '_enum_%s' % att_name
        enum = self.enum

        def set_enum(self, new_value):
            if hasattr(self, private_att_name):
                # Fetch previous value from private enum attribute.
                old_value = getattr(self, private_att_name)
            else:
                # First setattr no previous value on instance.
                old_value = new_value
            # Update private enum attribute with new value
            setattr(self, private_att_name, new_value)
            self.__dict__[att_name] = new_value
            # Run validation for new value.
            validators.validate_valid_transition(enum, old_value, new_value)

        def get_enum(self):
            return getattr(self, private_att_name)

        def delete_enum(self):
            self.__dict__[att_name] = None
            return setattr(self, private_att_name, None)

        if not sender._meta.abstract:
            setattr(sender, att_name, property(get_enum, set_enum, delete_enum))
796137
def field=(field)
      validator = EnumAttributeValidator.new('String', ["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"])
      unless validator.valid?(field)
        fail ArgumentError, "invalid value for 'field', must be one of #{validator.allowable_values}."
      end
      @field = field
    end
332956
def field_ok?(field)
      raise JSS::InvalidDataError, "Field elements must be hashes with :name, :type, and possibly :choices" unless field.kind_of? Hash
      raise JSS::InvalidDataError, "Fields require names" if field[:name].to_s.empty?
      raise JSS::InvalidDataError, "Fields :type must be one of: :#{FIELD_TYPES.join(', :')}" unless FIELD_TYPES.include? field[:type].to_sym

      if field[:type].to_sym == :menu
        unless field[:choices].kind_of? Array and  field[:choices].reject{|c| c.kind_of? String}.empty?
          raise JSS::InvalidDataError, "Choices for menu fields must be an Array of Strings"
        end # unless
      else
        field[:choices] = []
      end # if type -- menu
      true
    end
1272785
function processEnumType (type) {
  var fields = _.map(type.enumValues, enumValue => {
    var field = _.cloneDeep(enumValue)
    field.isEnumValue = true
    return field
  })
  return {
    name: type.name,
    isEnumType: true,
    fields: fields
  }
}
853573
def document_type=(document_type)
      validator = EnumAttributeValidator.new('String', ["pdf", "xls", "xlsx"])
      unless validator.valid?(document_type)
        fail ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
      end
      @document_type = document_type
    end
826716
def method=(method)
      validator = EnumAttributeValidator.new('String', ["ENUM", "FC"])
      unless validator.valid?(method)
        fail ArgumentError, "invalid value for 'method', must be one of #{validator.allowable_values}."
      end
      @method = method
    end
415628
function(form, options) {
      var values = {}
        , i
        , j
        , input
        , inputs
        , option
        , value;

      if (v.isJqueryElement(form)) {
        form = form[0];
      }

      if (!form) {
        return values;
      }

      options = options || {};

      inputs = form.querySelectorAll("input[name], textarea[name]");
      for (i = 0; i < inputs.length; ++i) {
        input = inputs.item(i);

        if (v.isDefined(input.getAttribute("data-ignored"))) {
          continue;
        }

        var name = input.name.replace(/\./g, "\\\\.");
        value = v.sanitizeFormValue(input.value, options);
        if (input.type === "number") {
          value = value ? +value : null;
        } else if (input.type === "checkbox") {
          if (input.attributes.value) {
            if (!input.checked) {
              value = values[name] || null;
            }
          } else {
            value = input.checked;
          }
        } else if (input.type === "radio") {
          if (!input.checked) {
            value = values[name] || null;
          }
        }
        values[name] = value;
      }

      inputs = form.querySelectorAll("select[name]");
      for (i = 0; i < inputs.length; ++i) {
        input = inputs.item(i);
        if (v.isDefined(input.getAttribute("data-ignored"))) {
          continue;
        }

        if (input.multiple) {
          value = [];
          for (j in input.options) {
            option = input.options[j];
             if (option && option.selected) {
              value.push(v.sanitizeFormValue(option.value, options));
            }
          }
        } else {
          var _val = typeof input.options[input.selectedIndex] !== 'undefined' ? input.options[input.selectedIndex].value : /* istanbul ignore next */ '';
          value = v.sanitizeFormValue(_val, options);
        }
        values[input.name] = value;
      }

      return values;
    }
858400
def pricing_type=(pricing_type)
      validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
      unless validator.valid?(pricing_type)
        fail ArgumentError, "invalid value for 'pricing_type', must be one of #{validator.allowable_values}."
      end
      @pricing_type = pricing_type
    end
210025
def attribute_syntax(attribute)
      type   = attribute_type(attribute)
      syntax = nil
      until type.nil? || syntax = type.syntax
        type = attribute_type(type.sup)
      end
      syntax
    end
712484
def strict=(strict)
      validator = EnumAttributeValidator.new('String', ["none"])
      unless validator.valid?(strict)
        fail ArgumentError, "invalid value for 'strict', must be one of #{validator.allowable_values}."
      end
      @strict = strict
    end