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

    Interface MapRules

    MapRules describe the rules applied to map values.

    interface MapRules {
        "[customJson]"?: () => unknown;
        "[unknownFieldsSymbol]"?: Uint8Array<ArrayBufferLike>;
        $type: "buf.validate.MapRules";
        keys?: FieldRules;
        maxPairs?: Long;
        minPairs?: Long;
        values?: FieldRules;
        [key: symbol]: Uint8Array<ArrayBufferLike> | (() => unknown) | undefined;
    }

    Indexable

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

      MapRules describe the rules applied to map values.

      • Uint8Array<ArrayBufferLike>
      • () => unknown
          • (): unknown
          • MapRules describe the rules applied to map 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.MapRules"

    Contains the fully qualified protobuf type name.

    keys?: FieldRules

    Specifies the rules to be applied to each key in the field.

    message MyMap {
    // The keys in the field `value` must follow the specified rules.
    map<string, string> value = 1 [(buf.validate.field).map.keys = {
    string: {
    min_len: 3
    max_len: 10
    }
    }];
    }

    Note that the required rule does not apply. Map keys cannot be unset.

    maxPairs?: Long

    Specifies the maximum number of key-value pairs allowed. If the field has more key-value pairs than specified, an error message is generated.

    message MyMap {
    // The field `value` must have at most 3 key-value pairs.
    map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
    }
    minPairs?: Long

    Specifies the minimum number of key-value pairs allowed. If the field has fewer key-value pairs than specified, an error message is generated.

    message MyMap {
    // The field `value` must have at least 2 key-value pairs.
    map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
    }
    values?: FieldRules

    Specifies the rules to be applied to the value of each key in the field. Message values will still have their validations evaluated unless ignore is specified.

    message MyMap {
    // The values in the field `value` must follow the specified rules.
    map<string, string> value = 1 [(buf.validate.field).map.values = {
    string: {
    min_len: 5
    max_len: 20
    }
    }];
    }

    Note that the required rule does not apply. Map values cannot be unset.