Optionalmetadata: MetadataThe supplied metadata object, or a new metadata object.
import { Metadata } from '@grpc/grpc-js';
import {
ensureResetMaskInMetadata,
RESET_MASK_HEADER,
} from '@nebius/js-sdk/runtime/resetmask';
const metadata = ensureResetMaskInMetadata(
{ displayName: '', enabled: false },
new Metadata(),
);
metadata.get(RESET_MASK_HEADER); // ["displayName,enabled"]
ErrRecursionTooDeep if the message is too deeply nested.
Adds a reset-mask header for an update message when one is not already set.
The function uses the supplied
Metadataobject, or creates one whenmetadatais absent. It does not replace an existingx-resetmaskvalue. It omits the header whenmsgisnullorundefined.The SDK normally calls this function for update requests. Call it directly only when you build gRPC metadata outside the standard request API.