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

    Interface BytesRules

    BytesRules describe the rules applied to bytes values. These rules may also be applied to the google.protobuf.BytesValue Well-Known-Type.

    interface BytesRules {
        "[customJson]"?: () => unknown;
        "[unknownFieldsSymbol]"?: Uint8Array<ArrayBufferLike>;
        $type: "buf.validate.BytesRules";
        const?: Uint8Array<ArrayBufferLike>;
        contains?: Uint8Array<ArrayBufferLike>;
        example: Uint8Array<ArrayBufferLike>[];
        in: Uint8Array<ArrayBufferLike>[];
        len?: Long;
        maxLen?: Long;
        minLen?: Long;
        notIn: Uint8Array<ArrayBufferLike>[];
        pattern?: string;
        prefix?: Uint8Array<ArrayBufferLike>;
        suffix?: Uint8Array<ArrayBufferLike>;
        wellKnown?:
            | { $case: "ip"; ip: boolean }
            | { $case: "ipv4"; ipv4: boolean }
            | { $case: "ipv6"; ipv6: boolean }
            | { $case: "uuid"; uuid: boolean };
        [key: symbol]: Uint8Array<ArrayBufferLike> | (() => unknown) | undefined;
    }

    Indexable

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

      BytesRules describe the rules applied to bytes values. These rules may also be applied to the google.protobuf.BytesValue Well-Known-Type.

      • Uint8Array<ArrayBufferLike>
      • () => unknown
          • (): unknown
          • BytesRules describe the rules applied to bytes values. These rules may also be applied to the google.protobuf.BytesValue Well-Known-Type.

            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.BytesRules"

    Contains the fully qualified protobuf type name.

    const?: Uint8Array<ArrayBufferLike>

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

    message MyBytes {
    // value must be "\x01\x02\x03\x04"
    bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
    }
    contains?: Uint8Array<ArrayBufferLike>

    contains requires the field value to have the specified bytes anywhere in the string. If the field value doesn't meet the requirement, an error message is generated.

    message MyBytes {
    // value does not contain \x02\x03
    optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
    }
    example: Uint8Array<ArrayBufferLike>[]

    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.

    message MyBytes {
    bytes value = 1 [
    (buf.validate.field).bytes.example = "\x01\x02",
    (buf.validate.field).bytes.example = "\x02\x03"
    ];
    }
    in: Uint8Array<ArrayBufferLike>[]

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

    message MyBytes {
    // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
    optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
    }
    len?: Long

    len requires the field value to have the specified length in bytes. If the field value doesn't match, an error message is generated.

    message MyBytes {
    // value length must be 4 bytes.
    optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
    }
    maxLen?: Long

    max_len requires the field value to have at most the specified maximum length in bytes. If the field value exceeds the requirement, an error message is generated.

    message MyBytes {
    // value must be at most 6 bytes.
    optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
    }
    minLen?: Long

    min_len requires the field value to have at least the specified minimum length in bytes. If the field value doesn't meet the requirement, an error message is generated.

    message MyBytes {
    // value length must be at least 2 bytes.
    optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
    }
    notIn: Uint8Array<ArrayBufferLike>[]

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

    message MyBytes {
    // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
    optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
    }
    pattern?: string

    pattern requires the field value to match the specified regular expression (RE2 syntax). The value of the field must be valid UTF-8 or validation will fail with a runtime error. If the field value doesn't match the pattern, an error message is generated.

    message MyBytes {
    // value must match regex pattern "^[a-zA-Z0-9]+$".
    optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
    }
    prefix?: Uint8Array<ArrayBufferLike>

    prefix requires the field value to have the specified bytes at the beginning of the string. If the field value doesn't meet the requirement, an error message is generated.

    message MyBytes {
    // value does not have prefix \x01\x02
    optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
    }
    suffix?: Uint8Array<ArrayBufferLike>

    suffix requires the field value to have the specified bytes at the end of the string. If the field value doesn't meet the requirement, an error message is generated.

    message MyBytes {
    // value does not have suffix \x03\x04
    optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
    }
    wellKnown?:
        | { $case: "ip"; ip: boolean }
        | { $case: "ipv4"; ipv4: boolean }
        | { $case: "ipv6"; ipv6: boolean }
        | { $case: "uuid"; uuid: boolean }

    WellKnown rules provide advanced rules against common byte patterns

    Type Declaration

    • { $case: "ip"; ip: boolean }
      • $case: "ip"

        Contains the case.

      • ip: boolean

        Contains the ip.

    • { $case: "ipv4"; ipv4: boolean }
      • $case: "ipv4"

        Contains the case.

      • ipv4: boolean

        Contains the ipv4.

    • { $case: "ipv6"; ipv6: boolean }
      • $case: "ipv6"

        Contains the case.

      • ipv6: boolean

        Contains the ipv6.

    • { $case: "uuid"; uuid: boolean }
      • $case: "uuid"

        Contains the case.

      • uuid: boolean

        Contains the uuid.