fork of hey-api/openapi-ts because I need some additional things
1import type { AnalysisContext } from '@hey-api/codegen-core';
2
3import { py } from '../../py-compiler';
4import { PyDsl } from '../base';
5
6const Mixed = PyDsl<py.Literal>;
7
8export class LiteralPyDsl extends Mixed {
9 readonly '~dsl' = 'LiteralPyDsl';
10
11 protected value: py.LiteralValue;
12
13 constructor(value: py.LiteralValue) {
14 super();
15 this.value = value;
16 }
17
18 override analyze(_ctx: AnalysisContext): void {
19 super.analyze(_ctx);
20 }
21
22 override toAst() {
23 return py.factory.createLiteral(this.value);
24 }
25}