class-validator#IsEnum TypeScript Examples

The following examples show how to use class-validator#IsEnum. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: createSubmission.dto.ts    From coronatest with GNU Affero General Public License v3.0 6 votes vote down vote up
@IsEnum([
        'harju',
        'tartu',
        'ida_viru',
        'pärnu',
        'lääne_viru',
        'viljandi',
        'rapla',
        'võru',
        'saare',
        'jõgeva',
        'järva',
        'valga',
        'põlva',
        'lääne',
        'hiiu'
    ])
    @IsOptional()
    county: string;
Example #2
Source File: classes.ts    From epicgames-freegames-node with MIT License 6 votes vote down vote up
/**
   * The search criteria for finding free games. Either the weekly promotion, and free promotion, or all free products.
   * @example weekly
   * @default all
   * @env SEARCH_STRATEGY
   */
  @IsOptional()
  @IsEnum(SearchStrategy)
  searchStrategy = process.env.SEARCH_STRATEGY || SearchStrategy.ALL;
Example #3
Source File: Captcha.ts    From tezos-academy with MIT License 5 votes vote down vote up
@Property({ required: true })
  @IsEnum(CaptchaFor)
  captchaFor!: CaptchaFor
Example #4
Source File: page-options.dto.ts    From bank-server with MIT License 5 votes vote down vote up
@ApiPropertyOptional({
    enum: Order,
    default: Order.ASC,
  })
  @IsEnum(Order)
  @IsOptional()
  readonly order?: Order = Order.ASC;
Example #5
Source File: relate-backup.model.ts    From relate with GNU General Public License v3.0 5 votes vote down vote up
@IsEnum(ENTITY_TYPES)
    public entityType!: ENTITY_TYPES;
Example #6
Source File: user-create-input.dto.ts    From nestjs-starter-rest-api with MIT License 5 votes vote down vote up
@ApiProperty()
  @IsArray()
  @ArrayNotEmpty()
  @IsEnum(ROLE, { each: true })
  roles: ROLE[];
Example #7
Source File: create-admin.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiProperty({ enum: AdminRole })
  @IsNotEmpty()
  @IsEnum(AdminRole)
  adminRole: AdminRole
Example #8
Source File: getSubmissions.dto.ts    From coronatest with GNU Affero General Public License v3.0 5 votes vote down vote up
@IsEnum(['ASC', 'DESC'])
    @IsOptional()
    sort_direction: string;
Example #9
Source File: users-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@ApiPropertyOptional({ description: 'Event types filter', enum: EventType })
  @IsOptional()
  @IsEnum(EventType)
  readonly event_type?: EventType;
Example #10
Source File: GetPostListAdapter.ts    From typescript-clean-architecture with MIT License 5 votes vote down vote up
@Expose()
  @IsOptional()
  @IsEnum(PostStatus)
  public status?: PostStatus;
Example #11
Source File: e2e.test.ts    From next-api-decorators with MIT License 5 votes vote down vote up
@IsOptional()
  @IsEnum(CreateSource)
  public source?: CreateSource;
Example #12
Source File: index.ts    From office-hours with GNU General Public License v3.0 5 votes vote down vote up
@IsEnum(AlertType)
  alertType!: AlertType;
Example #13
Source File: contact-info.dto.ts    From nestjs-starter with MIT License 5 votes vote down vote up
@ApiProperty()
  @IsEnum(GenderEnum)
  @IsOptional()
  gender?: GenderEnum;
Example #14
Source File: Quota.ts    From tezos-academy with MIT License 5 votes vote down vote up
@Property({ nullable: true, optional: true })
  @IsOptional()
  @IsEnum(QuotaType)
  quotaType?: QuotaType
Example #15
Source File: CreateMediaAdapter.ts    From typescript-clean-architecture with MIT License 5 votes vote down vote up
@Expose()
  @IsEnum(MediaType)
  public type: MediaType;
Example #16
Source File: auth.ts    From MyAPI with MIT License 5 votes vote down vote up
@ApiProperty({
    description: 'User role',
    type: DefaultRole
  })
  @IsEnum(DefaultRole)
  role?: DefaultRole
Example #17
Source File: create-transaction.dto.ts    From bank-server with MIT License 5 votes vote down vote up
@ApiProperty({
    enum: Language,
  })
  @IsEnum(Language)
  readonly locale: Language;
Example #18
Source File: upsert-deposit.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@IsEnum(BlockOperation)
  readonly type!: BlockOperation;
Example #19
Source File: classes.ts    From epicgames-freegames-node with MIT License 5 votes vote down vote up
@IsEnum(NotificationType)
  type: NotificationType;
Example #20
Source File: create-doubt.dto.ts    From edu-server with MIT License 5 votes vote down vote up
/**
   * The tags associated with the doubt
   * @example ["Web development"]
   */
  @IsNotEmpty()
  @IsArray()
  @IsEnum(TagType, { each: true })
  tags?: TagType[];
Example #21
Source File: user.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@Expose()
  @IsEnum(Gender)
  @ApiProperty({ enum: Gender })
  gender: Gender;
Example #22
Source File: update-doubt.dto.ts    From edu-server with MIT License 5 votes vote down vote up
/**
   * The tags associated with the doubt
   * @example ["Web development"]
   */
  @IsNotEmpty()
  @IsArray()
  @IsEnum(TagType, { each: true })
  tags?: TagType[];
Example #23
Source File: users.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@IsEnum(UserType)
  @IsOptional()
  userType: UserType;
Example #24
Source File: CreateProfileCommand.ts    From test with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@IsEnum(ProfileType)
  type: ProfileType
Example #25
Source File: set-admin-level.dto.ts    From aqualink-app with MIT License 5 votes vote down vote up
@IsNotEmpty()
  @IsEnum(AdminLevel)
  level: AdminLevel;
Example #26
Source File: get-payment-hub-bridges.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsEnum(NetworkNames)
  acceptedNetworkName?: NetworkNames;
Example #27
Source File: shards.ts    From Discord-Bot-TypeScript-Template with MIT License 5 votes vote down vote up
@IsDefined()
    @IsEnum(Constants.ActivityTypes)
    type: ActivityType;
Example #28
Source File: create-event.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@IsEnum(EventType)
  readonly type!: EventType;
Example #29
Source File: type_transformation.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsEnum(TransformationErrorActions)
    on_key_extraction_error: TransformationErrorAction = 'fail on required';