Creates the runtime class used by a generated protobuf enum.
SDK generator output calls this function. Applications normally use the generated enum export instead of calling the factory.
Fully qualified protobuf enum name.
Maps value names to numeric codes.
Optional
Optional original protobuf comments by value name.
import { createEnum } from '@nebius/js-sdk/runtime/protos/enum';const State = createEnum('example.State', { STATE_UNSPECIFIED: 0, READY: 1,});State.READY.toNumber(); // 1State.fromJSON('READY') === State.READY; // trueState.fromNumber(99).name; // "UNRECOGNIZED" Copy
import { createEnum } from '@nebius/js-sdk/runtime/protos/enum';const State = createEnum('example.State', { STATE_UNSPECIFIED: 0, READY: 1,});State.READY.toNumber(); // 1State.fromJSON('READY') === State.READY; // trueState.fromNumber(99).name; // "UNRECOGNIZED"
Creates the runtime class used by a generated protobuf enum.
SDK generator output calls this function. Applications normally use the generated enum export instead of calling the factory.