File: query_language.py

package info (click to toggle)
python-moto 5.1.18-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 116,520 kB
  • sloc: python: 636,725; javascript: 181; makefile: 39; sh: 3
file content (30 lines) | stat: -rw-r--r-- 786 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import annotations

import enum
from typing import Final

from moto.stepfunctions.parser.asl.antlr.runtime.ASLLexer import ASLLexer
from moto.stepfunctions.parser.asl.component.component import Component


class QueryLanguageMode(enum.Enum):
    JSONPath = ASLLexer.JSONPATH
    JSONata = ASLLexer.JSONATA

    def __str__(self):
        return self.name

    def __repr__(self):
        return f"QueryLanguageMode.{self}({self.value})"


DEFAULT_QUERY_LANGUAGE_MODE: Final[QueryLanguageMode] = QueryLanguageMode.JSONPath


class QueryLanguage(Component):
    query_language_mode: Final[QueryLanguageMode]

    def __init__(
        self, query_language_mode: QueryLanguageMode = DEFAULT_QUERY_LANGUAGE_MODE
    ):
        self.query_language_mode = query_language_mode