@nebius/js-sdk - v0.2.54
    Preparing search index...

    Interface EnumRules

    EnumRules describe the rules applied to enum values.

    interface EnumRules {
        "[customJson]"?: () => unknown;
        "[unknownFieldsSymbol]"?: Uint8Array<ArrayBufferLike>;
        $type: "buf.validate.EnumRules";
        const?: number;
        definedOnly?: boolean;
        example: number[];
        in: number[];
        notIn: number[];
        [key: symbol]: Uint8Array<ArrayBufferLike> | (() => unknown) | undefined;
    }

    Indexable

    • [key: symbol]: Uint8Array<ArrayBufferLike> | (() => unknown) | undefined

      EnumRules describe the rules applied to enum values.

      • Uint8Array<ArrayBufferLike>
      • () => unknown
          • (): unknown
          • EnumRules describe the rules applied to enum values.

            Returns unknown

      • undefined
    Index
    "[customJson]"?: () => unknown

    Returns a safe value for JSON logs.

    Type Declaration

      • (): unknown
      • Returns a safe value for JSON logs.

        Returns unknown

    "[unknownFieldsSymbol]"?: Uint8Array<ArrayBufferLike>

    Preserves protobuf fields that this SDK version does not recognize.

    $type: "buf.validate.EnumRules"

    Contains the fully qualified protobuf type name.

    const?: number

    const requires the field value to exactly match the specified enum value. If the field value doesn't match, an error message is generated.

    enum MyEnum {
    MY_ENUM_UNSPECIFIED = 0;
    MY_ENUM_VALUE1 = 1;
    MY_ENUM_VALUE2 = 2;
    }

    message MyMessage {
    // The field `value` must be exactly MY_ENUM_VALUE1.
    MyEnum value = 1 [(buf.validate.field).enum.const = 1];
    }
    definedOnly?: boolean

    defined_only requires the field value to be one of the defined values for this enum, failing on any undefined value.

    enum MyEnum {
    MY_ENUM_UNSPECIFIED = 0;
    MY_ENUM_VALUE1 = 1;
    MY_ENUM_VALUE2 = 2;
    }

    message MyMessage {
    // The field `value` must be a defined value of MyEnum.
    MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
    }
    example: number[]

    example specifies values that the field may have. These values SHOULD conform to other rules. example values will not impact validation but may be used as helpful guidance on how to populate the given field.

    enum MyEnum {
    MY_ENUM_UNSPECIFIED = 0;
    MY_ENUM_VALUE1 = 1;
    MY_ENUM_VALUE2 = 2;
    }

    message MyMessage {
    (buf.validate.field).enum.example = 1,
    (buf.validate.field).enum.example = 2
    }
    in: number[]

    in requires the field value to be equal to one of the specified enum values. If the field value doesn't match any of the specified values, an error message is generated.

    enum MyEnum {
    MY_ENUM_UNSPECIFIED = 0;
    MY_ENUM_VALUE1 = 1;
    MY_ENUM_VALUE2 = 2;
    }

    message MyMessage {
    // The field `value` must be equal to one of the specified values.
    MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
    }
    notIn: number[]

    not_in requires the field value to be not equal to any of the specified enum values. If the field value matches one of the specified values, an error message is generated.

    enum MyEnum {
    MY_ENUM_UNSPECIFIED = 0;
    MY_ENUM_VALUE1 = 1;
    MY_ENUM_VALUE2 = 2;
    }

    message MyMessage {
    // The field `value` must not be equal to any of the specified values.
    MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
    }