blob: 12212e8f5db941f3c8f86a14fa9ae0691fb7237c [file] [log] [blame] [edit]
# WARNING: This file is machine generated by fidlgen.
from __future__ import annotations
from dataclasses import dataclass
from fidl_codec import add_ir_path, encode_fidl_object
import sys
import typing
import enum
import fidl
from fidl._ir import get_fidl_ir_map
_ir_path = get_fidl_ir_map()["test.table"]
add_ir_path(_ir_path)
@dataclass
class EmptyTable:
__fidl_kind__ = "table"
__fidl_type__ = "EmptyTable"
__fidl_raw_type__ = "test.table/EmptyTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(self, "test.table", "test.table/EmptyTable")
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class ExtensionTable:
__fidl_kind__ = "table"
__fidl_type__ = "ExtensionTable"
__fidl_raw_type__ = "test.table/ExtensionTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/ExtensionTable"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class NewerSimpleTable:
x: int | None
y: int | None
z: int | None
def __init__(
self,
x: int | None = None,
y: int | None = None,
z: int | None = None,
) -> None:
self.x = x
self.y = y
self.z = z
__fidl_kind__ = "table"
__fidl_type__ = "NewerSimpleTable"
__fidl_raw_type__ = "test.table/NewerSimpleTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/NewerSimpleTable"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class OlderSimpleTable:
x: int | None
def __init__(
self,
x: int | None = None,
) -> None:
self.x = x
__fidl_kind__ = "table"
__fidl_type__ = "OlderSimpleTable"
__fidl_raw_type__ = "test.table/OlderSimpleTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/OlderSimpleTable"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class ReverseOrdinalTable:
z: int | None
y: int | None
x: int | None
def __init__(
self,
z: int | None = None,
y: int | None = None,
x: int | None = None,
) -> None:
self.z = z
self.y = y
self.x = x
__fidl_kind__ = "table"
__fidl_type__ = "ReverseOrdinalTable"
__fidl_raw_type__ = "test.table/ReverseOrdinalTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/ReverseOrdinalTable"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class SimpleTable:
x: int | None
y: int | None
def __init__(
self,
x: int | None = None,
y: int | None = None,
) -> None:
self.x = x
self.y = y
__fidl_kind__ = "table"
__fidl_type__ = "SimpleTable"
__fidl_raw_type__ = "test.table/SimpleTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(self, "test.table", "test.table/SimpleTable")
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class SixtyFourOrdinalTable:
v1: int | None
v2: int | None
v3: int | None
v4: int | None
v5: int | None
v6: int | None
v7: int | None
v8: int | None
v9: int | None
v10: int | None
v11: int | None
v12: int | None
v13: int | None
v14: int | None
v15: int | None
v16: int | None
v17: int | None
v18: int | None
v19: int | None
v20: int | None
v21: int | None
v22: int | None
v23: int | None
v24: int | None
v25: int | None
v26: int | None
v27: int | None
v28: int | None
v29: int | None
v30: int | None
v31: int | None
v32: int | None
v33: int | None
v34: int | None
v35: int | None
v36: int | None
v37: int | None
v38: int | None
v39: int | None
v40: int | None
v41: int | None
v42: int | None
v43: int | None
v44: int | None
v45: int | None
v46: int | None
v47: int | None
v48: int | None
v49: int | None
v50: int | None
v51: int | None
v52: int | None
v53: int | None
v54: int | None
v55: int | None
v56: int | None
v57: int | None
v58: int | None
v59: int | None
v60: int | None
v61: int | None
v62: int | None
v63: int | None
v64: ExtensionTable | None
def __init__(
self,
v1: int | None = None,
v2: int | None = None,
v3: int | None = None,
v4: int | None = None,
v5: int | None = None,
v6: int | None = None,
v7: int | None = None,
v8: int | None = None,
v9: int | None = None,
v10: int | None = None,
v11: int | None = None,
v12: int | None = None,
v13: int | None = None,
v14: int | None = None,
v15: int | None = None,
v16: int | None = None,
v17: int | None = None,
v18: int | None = None,
v19: int | None = None,
v20: int | None = None,
v21: int | None = None,
v22: int | None = None,
v23: int | None = None,
v24: int | None = None,
v25: int | None = None,
v26: int | None = None,
v27: int | None = None,
v28: int | None = None,
v29: int | None = None,
v30: int | None = None,
v31: int | None = None,
v32: int | None = None,
v33: int | None = None,
v34: int | None = None,
v35: int | None = None,
v36: int | None = None,
v37: int | None = None,
v38: int | None = None,
v39: int | None = None,
v40: int | None = None,
v41: int | None = None,
v42: int | None = None,
v43: int | None = None,
v44: int | None = None,
v45: int | None = None,
v46: int | None = None,
v47: int | None = None,
v48: int | None = None,
v49: int | None = None,
v50: int | None = None,
v51: int | None = None,
v52: int | None = None,
v53: int | None = None,
v54: int | None = None,
v55: int | None = None,
v56: int | None = None,
v57: int | None = None,
v58: int | None = None,
v59: int | None = None,
v60: int | None = None,
v61: int | None = None,
v62: int | None = None,
v63: int | None = None,
v64: ExtensionTable | None = None,
) -> None:
self.v1 = v1
self.v2 = v2
self.v3 = v3
self.v4 = v4
self.v5 = v5
self.v6 = v6
self.v7 = v7
self.v8 = v8
self.v9 = v9
self.v10 = v10
self.v11 = v11
self.v12 = v12
self.v13 = v13
self.v14 = v14
self.v15 = v15
self.v16 = v16
self.v17 = v17
self.v18 = v18
self.v19 = v19
self.v20 = v20
self.v21 = v21
self.v22 = v22
self.v23 = v23
self.v24 = v24
self.v25 = v25
self.v26 = v26
self.v27 = v27
self.v28 = v28
self.v29 = v29
self.v30 = v30
self.v31 = v31
self.v32 = v32
self.v33 = v33
self.v34 = v34
self.v35 = v35
self.v36 = v36
self.v37 = v37
self.v38 = v38
self.v39 = v39
self.v40 = v40
self.v41 = v41
self.v42 = v42
self.v43 = v43
self.v44 = v44
self.v45 = v45
self.v46 = v46
self.v47 = v47
self.v48 = v48
self.v49 = v49
self.v50 = v50
self.v51 = v51
self.v52 = v52
self.v53 = v53
self.v54 = v54
self.v55 = v55
self.v56 = v56
self.v57 = v57
self.v58 = v58
self.v59 = v59
self.v60 = v60
self.v61 = v61
self.v62 = v62
self.v63 = v63
self.v64 = v64
__fidl_kind__ = "table"
__fidl_type__ = "SixtyFourOrdinalTable"
__fidl_raw_type__ = "test.table/SixtyFourOrdinalTable"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/SixtyFourOrdinalTable"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()
@dataclass
class TableWithAttributes:
x: int | None
def __init__(
self,
x: int | None = None,
) -> None:
self.x = x
__fidl_kind__ = "table"
__fidl_type__ = "TableWithAttributes"
__fidl_raw_type__ = "test.table/TableWithAttributes"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.table", "test.table/TableWithAttributes"
)
@classmethod
def make_default(cls) -> typing.Self:
return cls()