# flytekit.models.interface

## Directory

### Classes

| Class | Description |
|-|-|
| [`Parameter`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.interface/page.md#flytekitmodelsinterfaceparameter) |  |
| [`ParameterMap`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.interface/page.md#flytekitmodelsinterfaceparametermap) |  |
| [`TypedInterface`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.interface/page.md#flytekitmodelsinterfacetypedinterface) |  |
| [`Variable`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.interface/page.md#flytekitmodelsinterfacevariable) |  |
| [`VariableMap`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.models.interface/page.md#flytekitmodelsinterfacevariablemap) |  |

## flytekit.models.interface.Parameter

### Parameters

```python
class Parameter(
    var,
    default,
    required,
    artifact_query: typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactQuery],
    artifact_id: typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactID],
)
```
Declares an input parameter.  A parameter is used as input to a launch plan and has
    the special ability to have a default value or mark itself as required.

| Parameter | Type | Description |
|-|-|-|
| `var` |  | |
| `default` |  | |
| `required` |  | |
| `artifact_query` | `typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactQuery]` | Specify this to bind to a query instead of a constant. |
| `artifact_id` | `typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactID]` | When you want to bind to a known artifact pointer. |

### Properties

| Property | Type | Description |
|-|-|-|
| `artifact_id` | `None` |  |
| `artifact_query` | `None` |  |
| `behavior` | `None` |  |
| `default` | `None` | This is the default literal value that will be applied for this parameter if not user specified. |
| `is_empty` | `None` |  |
| `required` | `None` | If True, this parameter must be specified.  There cannot be a default value. |
| `var` | `None` | The variable definition for this input parameter. |

### 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:** Parameter

#### 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.interface_pb2.Parameter

## flytekit.models.interface.ParameterMap

### Parameters

```python
class ParameterMap(
    parameters,
)
```
A map of Parameters

| Parameter | Type | Description |
|-|-|-|
| `parameters` |  | |

### Properties

| Property | Type | Description |
|-|-|-|
| `is_empty` | `None` |  |
| `parameters` | `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,
)
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` |  | |

**Returns:** ParameterMap

#### 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.interface_pb2.ParameterMap

## flytekit.models.interface.TypedInterface

### Parameters

```python
class TypedInterface(
    inputs,
    outputs,
)
```
Please note that this model is slightly incorrect, but is more user-friendly. The underlying inputs and
outputs are represented directly as Python dicts, rather than going through the additional VariableMap layer.

| Parameter | Type | Description |
|-|-|-|
| `inputs` |  | |
| `outputs` |  | |

### Properties

| Property | Type | Description |
|-|-|-|
| `inputs` | `None` |  |
| `is_empty` | `None` |  |
| `outputs` | `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) |  |
| [`transform_interface_to_list()`](#transform_interface_to_list) | Takes a single task interface and interpolates it to an array interface - to allow performing distributed. |

#### from_flyte_idl()

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

#### serialize_to_string()

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

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

#### to_flyte_idl()

```python
def to_flyte_idl()
```
#### transform_interface_to_list()

```python
def transform_interface_to_list(
    bound_inputs: typing.Set[str],
    excluded_inputs: typing.Set[str],
) -> TypedInterface
```
Takes a single task interface and interpolates it to an array interface - to allow performing distributed
python map like functions

| Parameter | Type | Description |
|-|-|-|
| `bound_inputs` | `typing.Set[str]` | fixed inputs that should not be updated to a list and will be maintained as is |
| `excluded_inputs` | `typing.Set[str]` | inputs that should be excluded from the new interface |

## flytekit.models.interface.Variable

### Parameters

```python
class Variable(
    type,
    description,
    artifact_partial_id: typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactID],
    artifact_tag: typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactTag],
)
```
| Parameter | Type | Description |
|-|-|-|
| `type` |  | |
| `description` |  | |
| `artifact_partial_id` | `typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactID]` | Optional Artifact object to control how the artifact is created when the task runs. |
| `artifact_tag` | `typing.Optional[flyteidl.core.artifact_id_pb2.ArtifactTag]` | Optional ArtifactTag object to automatically tag things. |

### Properties

| Property | Type | Description |
|-|-|-|
| `artifact_partial_id` | `None` |  |
| `artifact_tag` | `None` |  |
| `description` | `None` | This is a help string that can provide context for what this variable means in relation to a task or workflow. |
| `is_empty` | `None` |  |
| `type` | `None` | This describes the type of value that must be provided to satisfy this variable. |

### 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) |  |
| [`to_flyte_idl_list()`](#to_flyte_idl_list) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    variable_proto,
) -> flyteidl.core.interface_pb2.Variable
```
| Parameter | Type | Description |
|-|-|-|
| `variable_proto` |  | |

#### 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.interface_pb2.Variable

#### to_flyte_idl_list()

```python
def to_flyte_idl_list()
```
**Returns:** flyteidl.core.interface_pb2.Variable

## flytekit.models.interface.VariableMap

### Parameters

```python
class VariableMap(
    variables,
)
```
A map of Variables

| Parameter | Type | Description |
|-|-|-|
| `variables` |  | |

### Properties

| Property | Type | Description |
|-|-|-|
| `is_empty` | `None` |  |
| `variables` | `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,
)
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` |  | |

**Returns:** VariableMap

#### 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:** dict[Text, Variable]

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