Custom attribute writer method checking allowed values (enum).
 @param [Object] syncing Object to be assigned
489403
def syncing=(syncing)
      validator = EnumAttributeValidator.new('String', ["starting", "already_started"])
      unless validator.valid?(syncing)
        fail ArgumentError, "invalid value for 'syncing', must be one of #{validator.allowable_values}."
      end
      @syncing = syncing
    end
418021
def discount_type=(discount_type)
      validator = EnumAttributeValidator.new('String', ["FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
      unless validator.valid?(discount_type)
        fail ArgumentError, "invalid value for 'discount_type', must be one of #{validator.allowable_values}."
      end
      @discount_type = discount_type
    end
1239069
def have_enum_values(enum, values, headers = nil, &b)
      values.each do |value|
        have_enum_value(enum, value, headers, &b)
      end
    end
1089052
def acl=(acl)
      validator = EnumAttributeValidator.new('String', ["public", "private"])
      unless validator.valid?(acl)
        fail ArgumentError, "invalid value for 'acl', must be one of #{validator.allowable_values}."
      end
      @acl = acl
    end
573126
def validate_enum_attribute(self, attribute: str,
                                candidates: Set[Union[str, int, float]]) -> None:
        
        self.add_errors(
            validate_enum_attribute(self.fully_qualified_name, self._spec, attribute, candidates))
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
877296
def object_type=(object_type)
      validator = EnumAttributeValidator.new('String', ["ITEM", "DISCOUNT", "CATEGORY", "PLACEHOLDER"])
      unless validator.valid?(object_type)
        fail ArgumentError, "invalid value for 'object_type', must be one of #{validator.allowable_values}."
      end
      @object_type = object_type
    end
463422
def flag_color=(flag_color)
      validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
      unless validator.valid?(flag_color)
        fail ArgumentError, 'invalid value for "flag_color", must be one of #{validator.allowable_values}.'
      end
      @flag_color = flag_color
    end
1005486
def check_enum(enum, name=None, valid=None):
    
    name = name or 'enum'
    # Try to convert
    res = None
    if isinstance(enum, int):
        if hasattr(enum, 'name') and enum.name.startswith('GL_'):
            res = enum.name[3:].lower()
    elif isinstance(enum, string_types):
        res = enum.lower()
    # Check
    if res is None:
        raise ValueError('Could not determine string represenatation for'
                         'enum %r' % enum)
    elif valid and res not in valid:
        raise ValueError('Value of %s must be one of %r, not %r' % 
                         (name, valid, enum))
    return res
1093618
def entry_method=(entry_method)
      validator = EnumAttributeValidator.new('String', ["SWIPED", "KEYED", "EMV", "ON_FILE", "CONTACTLESS"])
      unless validator.valid?(entry_method)
        fail ArgumentError, "invalid value for 'entry_method', must be one of #{validator.allowable_values}."
      end
      @entry_method = entry_method
    end
638652
def valid?
      return false if @is_valid.nil?
      match_type_validator = EnumAttributeValidator.new('String', ["Exact", "StartsWith", "EndsWith", "Contains"])
      return false unless match_type_validator.valid?(@match_type)
      return true
    end
272076
def _write_enums(self, entity_name, attributes):
        
        
        self.enum_attrs_for_locale[entity_name] = attributes;

        for attribute in attributes:
            enum_name = "%s%sEnum" % (entity_name, attribute.name[0].upper() + attribute.name[1:])
            self.enum_list.append(enum_name)
            filename = "%s%s.js" % (self._class_prefix, enum_name)
            self.write(destination = self.enum_directory,
                        filename=filename,
                        template_name="enum.js.tpl",
                        class_prefix = self._class_prefix,
                        enum_name = enum_name,
                        allowed_choices = set(attribute.allowed_choices))
1149038
def have_enum_value(enum, value, headers = nil, &b)
      checking_for "#{enum}.#{value}" do
        if try_compile(<<"SRC", &b)
#{COMMON_HEADERS}
        #{cpp_include(headers)}
/*top*/
int main() { #{enum} t = #{value}; t = t; return 0; }
SRC
          $defs.push(format('-DHAVE_ENUM_%s', value.upcase))
          true
        else
          false
        end
      end
    end
790389
def visibility=(visibility)
      validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
      unless validator.valid?(visibility)
        fail ArgumentError, "invalid value for 'visibility', must be one of #{validator.allowable_values}."
      end
      @visibility = visibility
    end
153187
def valid?
      return false if @account_id.nil?
      return false if @date.nil?
      return false if @amount.nil?
      cleared_validator = EnumAttributeValidator.new('String', ['cleared', 'uncleared', 'reconciled'])
      return false unless cleared_validator.valid?(@cleared)
      flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
      return false unless flag_color_validator.valid?(@flag_color)
      true
    end
563419
def validate_enum_attribute(fully_qualified_name: str, spec: Dict[str, Any], attribute: str,
                            candidates: Set[Union[str, int, float]]) -> Optional[InvalidValueError]:
    

    if attribute not in spec:
        return

    if spec[attribute] not in candidates:
        return InvalidValueError(fully_qualified_name, spec, attribute, candidates)
457017
def valid_for_deletion?
      return false if(id.nil? || sync_token.nil?)
      id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
    end