Custom attribute writer method checking allowed values (enum).
 @param [Object] playlist_type Object to be assigned
487466
def playlist_type=(playlist_type)
      validator = EnumAttributeValidator.new('String', ["iframe", "iframe-only"])
      unless validator.valid?(playlist_type)
        fail ArgumentError, "invalid value for 'playlist_type', must be one of #{validator.allowable_values}."
      end
      @playlist_type = playlist_type
    end
1110062
def eac3_stereo_downmix_preference=(eac3_stereo_downmix_preference)
      validator = EnumAttributeValidator.new('String', ["m0", "m1", "m2", "m3"])
      unless validator.valid?(eac3_stereo_downmix_preference)
        fail ArgumentError, "invalid value for 'eac3_stereo_downmix_preference', must be one of #{validator.allowable_values}."
      end
      @eac3_stereo_downmix_preference = eac3_stereo_downmix_preference
    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
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
799508
def setPlaylistFields(playlist,name,description)
      method = 'setPlaylistFields'
      type = Boolean
      args = {:playlist=>playlist,:name=>name,:description=>description}
      return_object type,method,args,true
    end
858596
def playlist
      @_playlist ||= if playlists.any?
                       key, value = playlists.first
                       value
                     else
                       Playlist.new("Default")
                     end
    end
1139067
def frequency=(frequency)
      validator = EnumAttributeValidator.new('String', ['never', 'daily', 'weekly', 'everyOtherWeek', 'twiceAMonth', 'every4Weeks', 'monthly', 'everyOtherMonth', 'every3Months', 'every4Months', 'twiceAYear', 'yearly', 'everyOtherYear'])
      unless validator.valid?(frequency)
        fail ArgumentError, 'invalid value for "frequency", must be one of #{validator.allowable_values}.'
      end
      @frequency = frequency
    end
662313
def _string_check(self, value, allow_list=False):
        '''
        
        '''
        if self._optcre is self.OPTCRE or value:
            is_list = isinstance(value, list)
            if is_list and not allow_list:
                raise TypeError('option value cannot be a list unless allow_list is True')
            elif not is_list:
                value = [value]
            if not all(isinstance(x, six.string_types) for x in value):
                raise TypeError('option values must be strings')
563477
private void checkType(FieldType type, Field field) {
        Class<?> cls = field.getType();

        if (type == FieldType.OBJECT || type == FieldType.ENUM) {
            return;
        }

        String javaType = type.getJavaType();
        if (Integer.class.getSimpleName().equals(javaType)) {
            if (cls.getSimpleName().equals("int") || Integer.class.getSimpleName().equals(cls.getSimpleName())) {
                return;
            }
            throw new IllegalArgumentException(getMismatchTypeErroMessage(type, field));
        }
        if (!javaType.equalsIgnoreCase(cls.getSimpleName())) {
            throw new IllegalArgumentException(getMismatchTypeErroMessage(type, field));
        }
    }
1354895
def allowed_values(type, field, workspace = nil)
      rally_workspace_object(workspace)
  
      type_def = get_typedef_for(type, workspace)
      allowed_vals = {}
      type_def["Attributes"].each do |attr|
        next if attr["ElementName"] != field
        attr["AllowedValues"].each do |val_ref|
          val = val_ref["StringValue"]
          val = "Null" if val.nil? || val.empty?
          allowed_vals[val] = true
        end
      end
      allowed_vals
    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
170378
private static boolean allowCustomClass(DataSchema schema)
  {
    boolean result = false;
    final DataSchema.Type type = schema.getType();
    if (type == DataSchema.Type.TYPEREF || type == DataSchema.Type.RECORD)
    {
      // allow custom class only if the dereferenced type is a record or a primitive types that are not enums
      final DataSchema dereferencedSchema = schema.getDereferencedDataSchema();
      if (dereferencedSchema.getType() == DataSchema.Type.RECORD || (CodeUtil.isDirectType(dereferencedSchema) && dereferencedSchema.getType() != DataSchema.Type.ENUM))
      {
        result = true;
      }
    }
    return result;
  }
1201353
def eac3_lo_ro_center_mix_level=(eac3_lo_ro_center_mix_level)
      validator = EnumAttributeValidator.new('String', ["c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7"])
      unless validator.valid?(eac3_lo_ro_center_mix_level)
        fail ArgumentError, "invalid value for 'eac3_lo_ro_center_mix_level', must be one of #{validator.allowable_values}."
      end
      @eac3_lo_ro_center_mix_level = eac3_lo_ro_center_mix_level
    end
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
1301753
def enum(enum_type='enum', base_classes=None, methods=None, **attrs):
    
    # Enumerations can not be initalized as a new instance
    def __init__(instance, *args, **kwargs):
        raise RuntimeError('%s types can not be initialized.' % enum_type)

    if base_classes is None:
        base_classes = ()

    if methods is None:
        methods = {}

    base_classes = base_classes + (object,)
    for k, v in methods.items():
        methods[k] = classmethod(v)

    attrs['enums'] = attrs.copy()
    methods.update(attrs)
    methods['__init__'] = __init__
    return type(to_string(enum_type), base_classes, methods)
896829
def dnxhd_type=(dnxhd_type)
      validator = EnumAttributeValidator.new('String', ["36", "45", "60", "75", "90", "90x", "110", "115", "120", "145", "175x", "175", "185x", "185", "220x", "220"])
      unless validator.valid?(dnxhd_type)
        fail ArgumentError, "invalid value for 'dnxhd_type', must be one of #{validator.allowable_values}."
      end
      @dnxhd_type = dnxhd_type
    end
371514
def phone_type=(phone_type)
      validator = EnumAttributeValidator.new('String', ["Cell", "Home", "Work", "Other", ""])
      unless validator.valid?(phone_type)
        fail ArgumentError, "invalid value for 'phone_type', must be one of #{validator.allowable_values}."
      end
      @phone_type = phone_type
    end