fds.sdk.OptimizationEngineAPIMultiperiod 0.21.14
Optimization Engine API (Multi-period) client library for Python
License: Apache License, Version 2.0
Requires Python: >=3.7
Keywords: FactSet, API, SDK

[![FactSet](https://raw.githubusercontent.com/factset/enterprise-sdk/main/docs/images/factset-logo.svg)](https://www.factset.com)

# Optimization Engine API (Multi-period) client library for Python

[![API Version](https://img.shields.io/badge/api-v1-blue)]()
[![PyPi](https://img.shields.io/pypi/v/fds.sdk.OptimizationEngineAPIMultiperiod/0.21.14)](https://pypi.org/project/fds.sdk.OptimizationEngineAPIMultiperiod/v/0.21.14)
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1
- SDK version: 0.21.14
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements

* Python >= 3.7

## Installation

### Poetry

```shell
poetry add fds.sdk.utils fds.sdk.OptimizationEngineAPIMultiperiod==0.21.14
```

### pip

```shell
pip install fds.sdk.utils fds.sdk.OptimizationEngineAPIMultiperiod==0.21.14
```

## Usage

1. [Generate authentication credentials](../../../../README.md#authentication).
2. Setup Python environment.
   1. Install and activate python 3.7+. If you're using [pyenv](https://github.com/pyenv/pyenv):

      ```sh
      pyenv install 3.9.7
      pyenv shell 3.9.7
      ```

   2. (optional) [Install poetry](https://python-poetry.org/docs/#installation).
3. [Install dependencies](#installation).
4. Run the following:

> [!IMPORTANT]
> The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.

### Example Code

```python
from fds.sdk.utils.authentication import ConfidentialClient

import fds.sdk.OptimizationEngineAPIMultiperiod
from fds.sdk.OptimizationEngineAPIMultiperiod.api import default_api
from fds.sdk.OptimizationEngineAPIMultiperiod.models import *
from dateutil.parser import parse as dateutil_parser
from pprint import pprint

# See configuration.py for a list of all supported configuration parameters.

# Examples for each supported authentication method are below,
# choose one that satisfies your use case.

# (Preferred) OAuth 2.0: FactSetOAuth2
# See https://github.com/FactSet/enterprise-sdk#oauth-20
# for information on how to create the app-config.json file
#
# The confidential client instance should be reused in production environments.
# See https://github.com/FactSet/enterprise-sdk-utils-python#authentication
# for more information on using the ConfidentialClient class
configuration = fds.sdk.OptimizationEngineAPIMultiperiod.Configuration(
    fds_oauth_client=ConfidentialClient('/path/to/app-config.json')
)

# Basic authentication: FactSetApiKey
# See https://github.com/FactSet/enterprise-sdk#api-key
# for information how to create an API key
# configuration = fds.sdk.OptimizationEngineAPIMultiperiod.Configuration(
#     username='USERNAME-SERIAL',
#     password='API-KEY'
# )

# Enter a context with an instance of the API client
with fds.sdk.OptimizationEngineAPIMultiperiod.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)
    multi_period_input = OptimizerInputsMultiPeriodInput(
        strategy=OptimizerInputsMultiPeriodStrategy(
            objective=OptimizerInputsMultiPeriodObjective(
                factor_exposure=[
                    OptimizerInputsMPFactorExposureTerm(
                        term=OptimizerInputsFactorExposureTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            factors=[
                                "factors_example",
                            ],
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            rel_to_benchmark=True,
                            benchmark_index=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                volatility=[
                    OptimizerInputsMPVolatilityTerm(
                        term=OptimizerInputsVolatilityTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            risk_type=OptimizerInputsEObjectiveRiskTypeEnum(0),
                            factors=[
                                "factors_example",
                            ],
                            active_risk=True,
                            benchmark_index=1,
                        ),
                        term_on=OptimizerInputsBoundSourceEnum(0),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                general_linear=[
                    OptimizerInputsMPGeneralLinearTerm(
                        term=OptimizerInputsGeneralLinearTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            attribute=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            method=OptimizerInputsEAggregationMethodEnum(0),
                            rel_to_benchmark=True,
                            benchmark_index=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                expected_return=[
                    OptimizerInputsMPExpectedReturnTerm(
                        term=OptimizerInputsExpectedReturnTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            return_values=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            use_alpha=True,
                            rel_to_benchmark=True,
                            benchmark_index=1,
                        ),
                        term_on=OptimizerInputsBoundSourceEnum(0),
                        annualization_factor=3.14,
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                sensitivity=[
                    OptimizerInputsMPSensitivityTerm(
                        term=OptimizerInputsSensitivityTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            sensitivity_attribute=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            rel_to_benchmark=True,
                            benchmark_index=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                objective_ratio=OptimizerInputsMPObjectiveRatioTerm(
                    sharpe_ratio=OptimizerInputsSharpeRatioTerm(
                        name="name_example",
                        multiplier=OptimizerInputsValue(
                            value_type=OptimizerInputsEValueTypeEnum(0),
                            raw_value=3.14,
                            ref_index=1,
                        ),
                        risk_free_rate=OptimizerInputsValue(
                            value_type=OptimizerInputsEValueTypeEnum(0),
                            raw_value=3.14,
                            ref_index=1,
                        ),
                        direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                        active_risk=True,
                        benchmark_index=1,
                    ),
                    starr=OptimizerInputsSTARRTerm(
                        name="name_example",
                        multiplier=OptimizerInputsValue(
                            value_type=OptimizerInputsEValueTypeEnum(0),
                            raw_value=3.14,
                            ref_index=1,
                        ),
                        risk_free_rate=OptimizerInputsValue(
                            value_type=OptimizerInputsEValueTypeEnum(0),
                            raw_value=3.14,
                            ref_index=1,
                        ),
                        direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                        confidence_level=3.14,
                        use_centered_etl=True,
                        active_risk=True,
                        benchmark_index=1,
                    ),
                    diversification_ratio=OptimizerInputsDiversificationRatioTerm(
                        name="name_example",
                        multiplier=OptimizerInputsValue(
                            value_type=OptimizerInputsEValueTypeEnum(0),
                            raw_value=3.14,
                            ref_index=1,
                        ),
                        direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                    ),
                    on_periods=OptimizerInputsOnPeriods(
                        periods=[
                            1,
                        ],
                    ),
                    across_periods=OptimizerInputsAcrossPeriods(
                        start_period=1,
                        end_period=1,
                        rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                            frequency=1,
                            method=OptimizerInputsRollingMethodEnum(0),
                        ),
                    ),
                ),
                tail_risk=[
                    OptimizerInputsMPTailRiskTerm(
                        term=OptimizerInputsTailRiskTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            risk_measure=OptimizerInputsTailRiskMeasureEnum(0),
                            confidence_level=3.14,
                            use_centered_etl=True,
                            active_risk=True,
                            benchmark_index=1,
                        ),
                        term_on=OptimizerInputsBoundSourceEnum(0),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                target_probability=[
                    OptimizerInputsMPTargetProbabilityTerm(
                        term=OptimizerInputsTargetProbabilityTerm(
                            name="name_example",
                            multiplier=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
                            threshold_min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            threshold_max=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                        ),
                        constrain_on=OptimizerInputsBoundSourceEnum(0),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
            ),
            constraints=OptimizerInputsMultiPeriodConstraints(
                expected_returns=[
                    OptimizerInputsMPExpectedReturnConstraint(
                        constraint=OptimizerInputsExpectedReturnConstraint(
                            name="name_example",
                            min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            max=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            return_value=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            use_strategy_return_value=True,
                            penalty=OptimizerInputsPenalty(
                                enabled=True,
                                penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
                                penalty_value=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max_violation=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            level=OptimizerInputsEConstraintLevelEnum(0),
                            return_type=OptimizerInputsEConstraintReturnTypeEnum(0),
                            rel_to_benchmark=True,
                            benchmark_index=1,
                            hierarchy=1,
                        ),
                        constraint_on=OptimizerInputsBoundSourceEnum(0),
                        annualization_factor=3.14,
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                diversification=[
                    OptimizerInputsMPDiversificationConstraint(
                        constraint=OptimizerInputsDiversificationConstraint(
                            name="name_example",
                            asset_value=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            max_percent=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            penalty=OptimizerInputsPenalty(
                                enabled=True,
                                penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
                                penalty_value=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max_violation=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            unit=OptimizerInputsEConstraintUnitTypeEnum(0),
                            level=OptimizerInputsEConstraintLevelEnum(0),
                            hierarchy=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                    ),
                ],
                factor_exposures=[
                    OptimizerInputsMPFactorExposureConstraint(
                        constraint=OptimizerInputsFactorExposureConstraint(
                            name="name_example",
                            penalty=OptimizerInputsPenalty(
                                enabled=True,
                                penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
                                penalty_value=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max_violation=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            rel_to_benchmark=True,
                            benchmark_index=1,
                            factors=OptimizerInputsFactorExposureAttributes(
                                min=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            hierarchy=1,
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                general_linear=[
                    OptimizerInputsMPGeneralLinearConstraint(
                        constraint=OptimizerInputsGeneralLinearConstraint(
                            name="name_example",
                            security_attribute=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            max=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            penalty=OptimizerInputsPenalty(
                                enabled=True,
                                penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
                                penalty_value=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max_violation=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            weighting_method=OptimizerInputsEWeightingMethodTypeEnum(0),
                            level=OptimizerInputsEConstraintLevelEnum(0),
                            hierarchy=1,
                            rel_to_benchmark=True,
                            benchmark_index=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                        across_periods=OptimizerInputsAcrossPeriods(
                            start_period=1,
                            end_period=1,
                            rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
                                frequency=1,
                                method=OptimizerInputsRollingMethodEnum(0),
                            ),
                        ),
                    ),
                ],
                holding_threshold=[
                    OptimizerInputsMPHoldingsThresholdConstraint(
                        constraint=OptimizerInputsHoldingsThresholdConstraint(
                            name="name_example",
                            custom_asset=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
                            level=OptimizerInputsEConstraintLevelEnum(0),
                            unit=OptimizerInputsEConstraintUnitTypeEnum(0),
                            hierarchy=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                    ),
                ],
                leverage=[
                    OptimizerInputsMPLeverageConstraint(
                        constraint=OptimizerInputsLeverageConstraint(
                            name="name_example",
                            value=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            value_type=OptimizerInputsELeverageValueTypeEnum(0),
                            hierarchy=1,
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            level=OptimizerInputsEConstraintLevelEnum(0),
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                    ),
                ],
                num_of_assets=[
                    OptimizerInputsMPNumberofAssetsConstraint(
                        constraint=OptimizerInputsNumberofAssetsConstraint(
                            name="name_example",
                            min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            max=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    id="id_example",
                                    nested_groups=[],
                                    group_lookup_index=1,
                                ),
                            ],
                            level=OptimizerInputsEConstraintLevelEnum(0),
                            hierarchy=1,
                        ),
                        on_periods=OptimizerInputsOnPeriods(
                            periods=[
                                1,
                            ],
                        ),
                    ),
                ],
                sensitivity=[
                    OptimizerInputsMPSensitivityConstraint(
                        constraint=OptimizerInputsSensitivityConstraint(
                            name="name_example",
                            min=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            max=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            sensitivity_attribute=OptimizerInputsValue(
                                value_type=OptimizerInputsEValueTypeEnum(0),
                                raw_value=3.14,
                                ref_index=1,
                            ),
                            penalty=OptimizerInputsPenalty(
                                enabled=True,
                                penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
                                penalty_value=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                                max_violation=OptimizerInputsValue(
                                    value_type=OptimizerInputsEValueTypeEnum(0),
                                    raw_value=3.14,
                                    ref_index=1,
                                ),
                            ),
                            groups=[
                                OptimizerInputsConstraintGroup(
                                    min=OptimizerInputsValue(
                                        value_type=OptimizerInputsEValueTypeEnum(0),
                                        raw_value=3.14,
                                        ref_index=1,
                                    ),
                                    max=OptimizerInputsValue(
                                        value