# flytekit.models.types

## Directory

### Classes

| Class | Description |
|-|-|
| [`Error`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypeserror) |  |
| [`LiteralType`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypesliteraltype) |  |
| [`OutputReference`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypesoutputreference) |  |
| [`SchemaType`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypesschematype) |  |
| [`SimpleType`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypessimpletype) |  |
| [`StructuredDatasetType`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypesstructureddatasettype) |  |
| [`TypeStructure`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypestypestructure) | Models _types_pb2. |
| [`UnionType`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/page.md#flytekitmodelstypesuniontype) | Models _types_pb2. |

## flytekit.models.types.Error

### Parameters

```python
class Error(
    failed_node_id: str,
    message: str,
)
```
| Parameter | Type | Description |
|-|-|-|
| `failed_node_id` | `str` | |
| `message` | `str` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `failed_node_id` | `None` |  |
| `is_empty` | `None` |  |
| `message` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    pb2_object: flyteidl.core.types_pb2.Error,
) -> Error
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` | `flyteidl.core.types_pb2.Error` | |

**Returns:** Error

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
## flytekit.models.types.LiteralType

### Parameters

```python
class LiteralType(
    simple,
    schema,
    collection_type,
    map_value_type,
    blob,
    enum_type,
    union_type,
    structured_dataset_type,
    metadata,
    structure,
    annotation,
)
```
This is a oneof message, only one of the kwargs may be set, representing one of the Flyte types.

| Parameter | Type | Description |
|-|-|-|
| `simple` |  | |
| `schema` |  | |
| `collection_type` |  | |
| `map_value_type` |  | |
| `blob` |  | |
| `enum_type` |  | |
| `union_type` |  | |
| `structured_dataset_type` |  | |
| `metadata` |  | |
| `structure` |  | |
| `annotation` |  | |

### Properties

| Property | Type | Description |
|-|-|-|
| `annotation` | `None` |  |
| `blob` | `None` |  |
| `collection_type` | `None` | The collection value type |
| `enum_type` | `None` |  |
| `is_empty` | `None` |  |
| `map_value_type` | `None` | The Value for a dictionary. Key is always string |
| `metadata` | `None` |  |
| `schema` | `None` |  |
| `simple` | `None` |  |
| `structure` | `None` |  |
| `structured_dataset_type` | `None` |  |
| `union_type` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    proto,
)
```
| Parameter | Type | Description |
|-|-|-|
| `proto` |  | |

**Returns:** LiteralType

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
**Returns:** flyteidl.core.types_pb2.LiteralType

## flytekit.models.types.OutputReference

### Parameters

```python
class OutputReference(
    node_id,
    var,
    attr_path: typing.List[typing.Union[str, int]],
)
```
A reference to an output produced by a node. The type can be retrieved -and validated- from
    the underlying interface of the node.

| Parameter | Type | Description |
|-|-|-|
| `node_id` |  | |
| `var` |  | |
| `attr_path` | `typing.List[typing.Union[str, int]]` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `attr_path` | `None` | The attribute path the promise will be resolved with. |
| `is_empty` | `None` |  |
| `node_id` | `None` | Node id must exist at the graph layer. |
| `var` | `None` | Variable name must refer to an output variable for the node. |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    pb2_object,
)
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` |  | |

**Returns:** OutputReference

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
**Returns:** flyteidl.core.types.OutputReference

## flytekit.models.types.SchemaType

### Parameters

```python
class SchemaType(
    columns,
)
```
| Parameter | Type | Description |
|-|-|-|
| `columns` |  | |

### Properties

| Property | Type | Description |
|-|-|-|
| `columns` | `None` | A list of columns defining the underlying data frame. |
| `is_empty` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    proto,
)
```
| Parameter | Type | Description |
|-|-|-|
| `proto` |  | |

**Returns:** SchemaType

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
**Returns:** flyteidl.core.types_pb2.SchemaType

## flytekit.models.types.SimpleType

## flytekit.models.types.StructuredDatasetType

### Parameters

```python
class StructuredDatasetType(
    columns: typing.List[flytekit.models.types.StructuredDatasetType.DatasetColumn],
    format: str,
    external_schema_type: str,
    external_schema_bytes: bytes,
)
```
| Parameter | Type | Description |
|-|-|-|
| `columns` | `typing.List[flytekit.models.types.StructuredDatasetType.DatasetColumn]` | |
| `format` | `str` | |
| `external_schema_type` | `str` | |
| `external_schema_bytes` | `bytes` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `columns` | `None` |  |
| `external_schema_bytes` | `None` |  |
| `external_schema_type` | `None` |  |
| `format` | `None` |  |
| `is_empty` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    proto: flyteidl.core.types_pb2.StructuredDatasetType,
) -> flyteidl.core.types_pb2.StructuredDatasetType
```
| Parameter | Type | Description |
|-|-|-|
| `proto` | `flyteidl.core.types_pb2.StructuredDatasetType` | |

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
## flytekit.models.types.TypeStructure

Models _types_pb2.TypeStructure

### Parameters

```python
class TypeStructure(
    tag: str,
    dataclass_type: typing.Dict[str, ForwardRef('LiteralType')],
)
```
| Parameter | Type | Description |
|-|-|-|
| `tag` | `str` | |
| `dataclass_type` | `typing.Dict[str, ForwardRef('LiteralType')]` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `dataclass_type` | `None` |  |
| `is_empty` | `None` |  |
| `tag` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    proto: flyteidl.core.types_pb2.TypeStructure,
)
```
| Parameter | Type | Description |
|-|-|-|
| `proto` | `flyteidl.core.types_pb2.TypeStructure` | |

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
## flytekit.models.types.UnionType

Models _types_pb2.UnionType

### Parameters

```python
class UnionType(
    variants: typing.List[ForwardRef('LiteralType')],
)
```
| Parameter | Type | Description |
|-|-|-|
| `variants` | `typing.List[ForwardRef('LiteralType')]` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `is_empty` | `None` |  |
| `variants` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    proto: flyteidl.core.types_pb2.UnionType,
)
```
| Parameter | Type | Description |
|-|-|-|
| `proto` | `flyteidl.core.types_pb2.UnionType` | |

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flytekit-sdk/packages/flytekit.models.types.md
**HTML**: https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.types/
