diff --git a/.flake8 b/.flake8 index 41573c4a..a4bf10f8 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,9 @@ [flake8] -exclude = venv, __init__.py, doc/_build, .venv -select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403 -count = True -max-complexity = 10 max-line-length = 100 -statistics = True +# schema/ contains reference generated client code that is not part of the published package. +# src/ansys/conceptev/core/generated/ contains auto-generated client code whose long docstring +# lines cannot be automatically wrapped by black without breaking the generator output. +extend-exclude = schema,openapi.json +per-file-ignores = + src/ansys/conceptev/core/generated/*:E501 + scripts/*:E501 diff --git a/.gitignore b/.gitignore index 63aca03e..f206cc9c 100644 --- a/.gitignore +++ b/.gitignore @@ -161,10 +161,11 @@ cython_debug/ # e2e / optiSLang test artefacts and local debug logs test_working_dir/ tests/e2e/test_working_dir/ +ci_*.txt +ci_failing_job_logs_*.txt ci_log_*.txt ci_*_out.txt ci_*_full.txt -ci_failing_job_logs_*.txt *_pytest_output*.txt e2e_pytest_*.txt poetry_lock_output.txt @@ -172,4 +173,8 @@ shell_test_out.txt # Local secret / credential files CONCEPTEV_PASSWORD +conceptev_password token_cache.bin +examples/project_results.json +examples/results.xlsx +examples/created_designs.xlsx diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4945f3fe..67cc6630 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,7 @@ repos: rev: 24.4.2 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!! hooks: - id: black + exclude: ^schema/ - repo: https://github.com/adamchainz/blacken-docs rev: 1.16.0 @@ -15,11 +16,13 @@ repos: rev: 5.13.2 hooks: - id: isort + exclude: ^schema/ - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 hooks: - id: flake8 + exclude: ^schema/ - repo: https://github.com/codespell-project/codespell rev: v2.2.6 @@ -32,7 +35,7 @@ repos: hooks: - id: pydocstyle additional_dependencies: [tomli] - exclude: "^(tests|examples)" + exclude: "^(tests|examples|src/ansys/conceptev/core/generated|schema)" - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 @@ -47,6 +50,7 @@ repos: - id: add-license-headers args: - --start_year=2023 + exclude: "^(src/ansys/conceptev/core/generated|schema)" # Validate the pre-commit.ci configuration - repo: https://github.com/pre-commit-ci/pre-commit-ci-config diff --git a/doc/changelog.d/344.added.md b/doc/changelog.d/344.added.md new file mode 100644 index 00000000..1301ed5d --- /dev/null +++ b/doc/changelog.d/344.added.md @@ -0,0 +1 @@ +Added codegen diff --git a/doc/source/conf.py b/doc/source/conf.py index 1d457e47..953830a0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -138,8 +138,15 @@ # Modules for which function level galleries are created. In "doc_module": "ansys-conceptev-core", "image_scrapers": ("matplotlib"), - "ignore_pattern": "flycheck*", + # Exclude flycheck temp files and v2 examples (require dev credentials not + # available during the production doc build). + "ignore_pattern": r"flycheck|0[456]_v2_", "thumbnail_size": (350, 350), + # v1 examples (01-03) run against production using the conceptev_testing + # service account. They are expected to succeed; abort_on_example_error + # is kept False so a single transient failure doesn't break the whole build. + "abort_on_example_error": False, + "expected_failing_examples": [], } linkcheck_exclude_documents = ["index"] @@ -194,10 +201,10 @@ def copy_examples(app): size = directory_size(destination_dir) logger.info(f"Directory {destination_dir} ({size} MB) already exist, removing it.") shutil.rmtree(destination_dir) - logger.info(f"Directory removed.") + logger.info("Directory removed.") shutil.copytree(EXAMPLES_DIRECTORY, destination_dir) - logger.info(f"Copy performed") + logger.info("Copy performed") def remove_examples(app, exception): @@ -207,7 +214,7 @@ def remove_examples(app, exception): size = directory_size(destination_dir) logger.info(f"Removing directory {destination_dir} ({size} MB).") shutil.rmtree(destination_dir, ignore_errors=True) - logger.info(f"Directory removed.") + logger.info("Directory removed.") def setup(app: sphinx.application.Sphinx): diff --git a/doc/source/user_guide.rst b/doc/source/user_guide.rst index a940e92e..d47eade9 100644 --- a/doc/source/user_guide.rst +++ b/doc/source/user_guide.rst @@ -5,31 +5,188 @@ User guide This section explains how to use PyConceptEV. -Create a client -^^^^^^^^^^^^^^^ +Create a client (local server, v2 API) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Create a client that can access and talk to the Ansys ConceptEV API. You can use -the health check endpoint to check your connection. -The token is cached within a file called `token_cache.bin` you can configure the cache location with -an argument to the `get_http_client` function `cache_filepath`. +Use ``get_local_client`` to connect to a locally running ConceptEV service at +``http://127.0.0.1:8080/api``. No authentication is required. The returned +client is a typed generated client that works directly with the v2 API modules. .. code-block:: python - import ansys.conceptev.core.main as pyconceptev + from ansys.conceptev.core.app import get_local_client + from ansys.conceptev.core.generated.api.concept_v2 import ( + create_concept, + create_concept_part, + create_job, + get_job, + ) + from ansys.conceptev.core.generated.models import ( + AeroInput, + ArchitectureInput, + BatteryFixedVoltagesInput, + ConceptInput, + DynamicRequirementInput, + MassInput, + TransmissionLossCoefficientsInput, + WheelInput, + ) + from ansys.conceptev.core.generated.models.job_request import JobRequest + + with get_local_client() as client: + # Create a study + concept = create_concept.sync( + client=client, + body=ConceptInput(name="My Study"), + ) + concept_id = concept.id + + # Add configurations + aero = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=AeroInput(name="Aero", drag_coefficient=0.3, cross_sectional_area=2.0), + ) + mass = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=MassInput(name="Mass", mass=2000.0), + ) + wheel = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=WheelInput(name="Wheel", rolling_radius=0.3), + ) + + # Add components + transmission = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=TransmissionLossCoefficientsInput( + name="Transmission", + gear_ratios=[5.0], + headline_efficiencies=[0.95], + max_torque=500.0, + max_speed=2000.0, + static_drags=[0.5], + friction_ratios=[60.0], + ), + ) + battery = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=BatteryFixedVoltagesInput(name="Battery", voltage_max=400.0), + ) + + # Add architecture + arch = create_concept_part.sync( + id=concept_id, + part_type="architecture", + client=client, + body=ArchitectureInput( + battery_id=battery.id, + number_of_front_motors=1, + front_transmission_id=transmission.id, + ), + ) + + # Add requirement and submit job + req = create_concept_part.sync( + id=concept_id, + part_type="requirement", + client=client, + body=DynamicRequirementInput( + name="Req 1", + aero_id=aero.id, + mass_id=mass.id, + wheel_id=wheel.id, + ), + ) + job = create_job.sync( + concept_id=concept_id, + client=client, + body=JobRequest( + name="My Job", + requirement_ids=[req.id], + architecture_id=arch.id, + ), + ) + print(f"Job submitted: {job.id}, status: {job.status}") + + +Create a client (cloud service, legacy API) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For the hosted Ansys ConceptEV cloud service, use ``get_http_client`` (legacy +raw ``httpx`` client with MSAL authentication) or ``get_conceptev_client`` +(typed generated client with MSAL authentication). + +The token is cached in a file called ``token_cache.bin``. You can configure +the cache location with the ``cache_filepath`` argument. - with pyconceptev.get_http_client( - concept_id, cache_filepath="token_cache.bin" - ) as client: - health = get(client, "/health") - print(health) +.. code-block:: python + + from ansys.conceptev.core.app import get_conceptev_client + + with get_conceptev_client() as client: + # Use with generated API modules (same as local client above) + ... + + +Upload a file component +^^^^^^^^^^^^^^^^^^^^^^^ + +To use file-based components (motor lab files, battery lookup tables, etc.) +upload the file first, then reference the returned file ID when creating the +component: + +.. code-block:: python + + from ansys.conceptev.core.generated.api.concept_v2 import ( + create_file_item, + create_concept_part, + ) + from ansys.conceptev.core.generated.models import ( + BodyCreateFileItem, + MotorLabInput, + ) + + with open("e9.lab", "rb") as f: + file_resp = create_file_item.sync( + id=concept_id, + client=client, + body=BodyCreateFileItem(file=f.read().decode("latin-1")), + name="e9.lab", + component_file_type="motor_lab_file", + ) + + motor = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=MotorLabInput( + name="e9 Motor", + lab_data_id=file_resp.id, + max_speed=file_resp.calculated_values["max_speed"], + ), + ) Update configuration ^^^^^^^^^^^^^^^^^^^^ -Update the configuration of the client by using the `config.toml` the defaults are located in `src/ansys/conceptev/core/resources/config.toml`. -Create a new config.toml file in your working directory with the `account_name` set or create an environment variable called `ACCOUNT_NAME` and the settings management should find it. -Most things can be left as default but the `account_name` should be changed to match your `company account name`. +Update the configuration of the client by using the ``config.toml``. The +defaults are located in ``src/ansys/conceptev/core/resources/config.toml``. +Create a new ``config.toml`` file in your working directory with the +``account_name`` set or create an environment variable called ``ACCOUNT_NAME`` +and the settings management will find it. +Most things can be left as default but the ``account_name`` should be changed +to match your company account name. Configure SSL certificate for company networks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/examples/02_get_results_workflow.py b/examples/02_get_results_workflow.py index 8169fe1e..b647bbac 100644 --- a/examples/02_get_results_workflow.py +++ b/examples/02_get_results_workflow.py @@ -89,7 +89,7 @@ def generate_and_run_templates(client, account_id, hpc_id): project_id["projectId"], f"New Concept {datetime.datetime.now()}", token ) concept = app.copy_concept(template_id, design_instance_id, client) - job_info = app.create_submit_job( + app.create_submit_job( client, concept, account_id, diff --git a/examples/04_v2_simple_workflow.py b/examples/04_v2_simple_workflow.py new file mode 100644 index 00000000..ba045b2b --- /dev/null +++ b/examples/04_v2_simple_workflow.py @@ -0,0 +1,347 @@ +# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +""" +Simple workflow (v2 API) +======================== + +This example shows how to use PyConceptEV to perform basic operations using +the v2 generated API client against the ConceptEV dev environment. + +The example uses the ``conceptev_testing@ansys.com`` service account. An +``examples/config.toml`` is provided with all required dev-environment +settings. Before running, supply the account password via the +``CONCEPTEV_PASSWORD`` environment variable (or a file named +``conceptev_password`` in the working directory). + +- Required imports +- Authenticate against the dev ConceptEV service +- Create a concept +- Add configurations, components, architecture, and requirements +- Submit a job and plot the results +""" + +# %% +# Perform Required imports +# ------------------------ + +from pathlib import Path +import time + +import matplotlib.pyplot as plt + +from ansys.conceptev.core import app +from ansys.conceptev.core.app import get_conceptev_client +from ansys.conceptev.core.generated.api.concept_v2 import ( + create_concept, + create_concept_part, + create_file_item, + create_job, + delete_concept, + get_component_display_data, + get_job, +) +from ansys.conceptev.core.generated.models import ( + AeroInput, + ArchitectureInput, + BatteryFixedVoltagesInput, + BodyCreateFileItem, + ConceptInput, + DynamicRequirementInput, + MassInput, + MotorLabInput, + TransmissionLossCoefficientsInput, + WheelInput, +) +from ansys.conceptev.core.generated.models.job_request import JobRequest + +# %% +# Define example data +# --------------------- +# You can obtain example data from the schema sections of the API documentation. + +MOTOR_LAB_FILE = Path("resources") / "e9.lab" + +# %% +# Obtain account ID +# ----------------- +# The account ID is required when submitting jobs to the v2 API. +# It is retrieved from the token issued by the OCM authentication service. + +with app.get_http_client() as http_client: + token = app.get_token(http_client) + account_id = app.get_account_id(token) + print(f"Using account ID: {account_id}") + +# %% +# Connect to the ConceptEV dev service and create a concept +# --------------------------------------------------------- +# ``get_conceptev_client`` returns a generated v2 API client whose underlying +# HTTP session is pre-configured with AnsysID authentication and retry logic. +# The target URL is read from ``settings.conceptev_url`` (set via config.toml). + +with get_conceptev_client() as client: + + # Create a new concept (study) on the server. + concept = create_concept.sync( + client=client, + body=ConceptInput(name="Simple Workflow Study"), + ) + print(f"Created concept with ID: {concept.id}\n") + concept_id = concept.id + + # %% + # Add configurations + # ------------------ + # Create aero, mass, and wheel configurations and attach them to the concept. + + created_aero = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=AeroInput( + name="New Aero Config", + drag_coefficient=0.3, + cross_sectional_area=2.0, + ), + ) + print(f"Created aero config with ID: {created_aero.id}\n") + + created_aero2 = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=AeroInput( + name="Second Aero Configuration", + drag_coefficient=0.6, + cross_sectional_area=3.0, + ), + ) + + created_mass = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=MassInput(name="New Mass Config", mass=3000.0), + ) + print(f"Created mass config with ID: {created_mass.id}\n") + + created_wheel = create_concept_part.sync( + id=concept_id, + part_type="configuration", + client=client, + body=WheelInput(name="New Wheel Config", rolling_radius=0.3), + ) + print(f"Created wheel config with ID: {created_wheel.id}\n") + + # %% + # Add components + # -------------- + # Create a transmission component. + + created_transmission = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=TransmissionLossCoefficientsInput( + name="New Transmission", + gear_ratios=[5.0], + headline_efficiencies=[0.95], + max_torque=500.0, + max_speed=2000.0, + static_drags=[0.5], + friction_ratios=[60.0], + ), + ) + print(f"Created transmission with ID: {created_transmission.id}\n") + + # %% + # Upload a motor lab file and create a motor component + # ---------------------------------------------------- + # Upload the .lab file to obtain a file ID and the extracted max speed. + # Then create a MotorLabInput component that references that file. + + with open(MOTOR_LAB_FILE, "rb") as f: + file_response = create_file_item.sync( + id=concept_id, + client=client, + body=BodyCreateFileItem(file=f.read().decode("latin-1")), + name=MOTOR_LAB_FILE.name, + component_file_type="motor_lab_file", + ) + print(f"Uploaded motor lab file, file ID: {file_response.id}\n") + + lab_data_id = file_response.id + max_speed = file_response.calculated_values["max_speed"] + + created_motor = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=MotorLabInput( + name="e9", + lab_data_id=lab_data_id, + max_speed=max_speed, + ), + ) + print(f"Created motor with ID: {created_motor.id}\n") + + # %% + # Get display data (loss map) for the motor + # ----------------------------------------- + # Retrieve and plot the motor loss map. + + loss_map = get_component_display_data.sync( + id=concept_id, + part_id=created_motor.id, + client=client, + body=None, + ) + + if loss_map is not None and hasattr(loss_map, "currents"): + x = loss_map.currents + y = loss_map.phase_advances + z = loss_map.losses_total + + fig, ax = plt.subplots() + im = ax.pcolormesh(x, y, z) + ax.set_xlabel("Currents (A)") + ax.set_ylabel("Phase Advances (deg)") + fig.colorbar(im, ax=ax, label="Total Losses (W)") + plt.show() + + # %% + # Add battery component + # --------------------- + + created_battery = create_concept_part.sync( + id=concept_id, + part_type="component", + client=client, + body=BatteryFixedVoltagesInput( + name="New Battery", + voltage_max=400.0, + voltage_min=300.0, + capacity=86400000.0, + charge_acceptance_limit=0.0, + internal_resistance_charge=0.1, + internal_resistance_discharge=0.1, + ), + ) + print(f"Created battery with ID: {created_battery.id}\n") + + # %% + # Create an architecture + # ---------------------- + # Wire together motor, transmission, and battery into a front-motor architecture. + + created_arch = create_concept_part.sync( + id=concept_id, + part_type="architecture", + client=client, + body=ArchitectureInput( + battery_id=created_battery.id, + number_of_front_wheels=2, + number_of_front_motors=1, + front_transmission_id=created_transmission.id, + front_motor_id=created_motor.id, + number_of_rear_wheels=2, + number_of_rear_motors=0, + ), + ) + print(f"Created architecture with ID: {created_arch.id}\n") + + # %% + # Create a requirement + # -------------------- + # Add a dynamic (acceleration) requirement referencing the configurations above. + + created_requirement = create_concept_part.sync( + id=concept_id, + part_type="requirement", + client=client, + body=DynamicRequirementInput( + name="Dynamic Requirement 1", + aero_id=created_aero.id, + mass_id=created_mass.id, + wheel_id=created_wheel.id, + state_of_charge=0.9, + ), + ) + print(f"Created requirement with ID: {created_requirement.id}\n") + + # %% + # Submit a job and poll until complete + # ------------------------------------- + # Create a job that runs the requirement against the architecture. + # The account_id obtained earlier must be included in the job request body. + + job_record = create_job.sync( + concept_id=concept_id, + client=client, + body=JobRequest( + name="Simple Workflow Job", + account_id=account_id, + requirement_ids=[created_requirement.id], + architecture_id=created_arch.id, + ), + ) + print(f"Submitted job with ID: {job_record.id}, status: {job_record.status}\n") + + # Poll until the job reaches a terminal state. + terminal_states = {"COMPLETED", "FAILED", "ERROR"} + while job_record.status not in terminal_states: + time.sleep(5) + job_record = get_job.sync( + concept_id=concept_id, + job_id=job_record.id, + client=client, + ) + print(f"Job status: {job_record.status}") + + print(f"Job finished with status: {job_record.status}\n") + + # %% + # Plot capability curve from results + # ----------------------------------- + # Read the results from the completed job and display a capability curve. + + if job_record.status == "COMPLETED" and job_record.files: + import httpx as _httpx # noqa: PLC0415 + + results_url = job_record.files[0].path + results = _httpx.get(results_url).json() + x = results[0]["capability_curve"]["speeds"] + y = results[0]["capability_curve"]["torques"] + + fig, ax = plt.subplots() + ax.scatter(x, y, label="Capability Curve") + ax.set_xlabel("Speed (rad/s)") + ax.set_ylabel("Torque (Nm)") + plt.show() + + # %% + # Clean up + # -------- + # Delete the concept from the server when finished. + + delete_concept.sync(id=concept_id, client=client) + print(f"Deleted concept {concept_id}") diff --git a/examples/05_v2_get_results_workflow.py b/examples/05_v2_get_results_workflow.py new file mode 100644 index 00000000..a8f626b8 --- /dev/null +++ b/examples/05_v2_get_results_workflow.py @@ -0,0 +1,161 @@ +# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +""" +Get Results workflow (v2 API) +============================== + +This example shows how to use the v2 PyConceptEV generated client to collect +results for a list of concept IDs and export them to Excel. + +The concept IDs are provided in ``resources/design_instance_ids.csv``. + +The example uses the ``conceptev_testing@ansys.com`` service account against +the dev ConceptEV environment. An ``examples/config.toml`` is provided with +all required settings. Before running, supply the account password via the +``CONCEPTEV_PASSWORD`` environment variable (or a file named +``conceptev_password`` in the working directory). + +.. note:: + Set ``get_results_off_server = True`` to fetch live results from the dev + server and save them to ``project_results.json``. Set it to ``False`` on + subsequent runs to iterate quickly on the Excel output without hitting the + server again. + +.. warning:: + Assumes the first completed job in each concept is the result we want. +""" + +# %% +# Perform required imports +# ------------------------ + +import json +import time + +import matplotlib.pyplot as plt +import pandas as pd + +from ansys.conceptev.core.app import get_conceptev_client +from ansys.conceptev.core.generated.api.concept_v2 import get_concept, get_job, list_jobs + +# %% +# Inputs +# ------ +# Change the following variables to match your data. + +get_results_off_server = True # Set False to skip server fetch and read from project_results.json. +output_filename = "results.xlsx" # Output filename for results. + +# %% +# Helper functions +# ---------------- + + +def wait_for_job(client, concept_id: str, job_id: str, poll_interval: int = 5) -> object: + """Poll the job endpoint until it reaches a terminal state and return the record.""" + terminal_states = {"COMPLETED", "FAILED", "ERROR"} + while True: + job = get_job.sync( + concept_id=concept_id, + job_id=job_id, + client=client, + ) + if job.status in terminal_states: + return job + print(f" Job {job_id} status: {job.status} — waiting {poll_interval}s…") + time.sleep(poll_interval) + + +def get_results_for_concept(client, concept_id: str) -> dict: + """Return results for the first completed job of a concept.""" + concept = get_concept.sync(id=concept_id, client=client) + + jobs = list_jobs.sync(concept_id=concept_id, client=client) + if not jobs: + raise RuntimeError(f"No jobs found for concept {concept_id}") + + job = wait_for_job(client, concept_id, jobs[0].id) + + results = None + if job.status == "COMPLETED" and job.files: + import httpx as _httpx # noqa: PLC0415 + + results_url = job.files[0].path + results = _httpx.get(results_url).json() + + return { + "concept_id": concept_id, + "concept_name": concept.name, + "job_id": job.id, + "results": results, + } + + +# %% +# Load concept IDs and collect results +# ------------------------------------ + +concept_ids_df = pd.read_csv( + "resources/design_instance_ids.csv", header=None, names=["design_instance_id"] +) +concept_ids = concept_ids_df["design_instance_id"].tolist() + +if get_results_off_server: + with get_conceptev_client() as client: + all_results = [get_results_for_concept(client, cid) for cid in concept_ids] + + with open("project_results.json", "w") as f: + json.dump(all_results, f) +else: + with open("project_results.json") as f: + all_results = json.load(f) + +# %% +# Build output DataFrame and export to Excel +# ------------------------------------------ + +output_rows = [] +for result in all_results: + if result["results"] is None: + continue + row = { + "Concept ID": result["concept_id"], + "Concept Name": result["concept_name"], + "Job ID": result["job_id"], + } + # Extend here to extract specific result fields, for example: + # row["total_tractive_power"] = result["results"][0]["requirement"]["total_tractive_power"] + output_rows.append(row) + +df = pd.DataFrame(output_rows) +print(df) + +if output_rows: + plt.figure() + plt.bar(df["Concept Name"], range(len(df))) + plt.xlabel("Concept Name") + plt.ylabel("Index") + plt.tight_layout() + plt.show() + +df.to_excel(output_filename, index=False) +print(f"Results written to {output_filename}") diff --git a/examples/06_v2_bulk_job_submit.py b/examples/06_v2_bulk_job_submit.py new file mode 100644 index 00000000..73249621 --- /dev/null +++ b/examples/06_v2_bulk_job_submit.py @@ -0,0 +1,229 @@ +# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +""" +Bulk Job Submit (v2 API) +======================== + +Example script to bulk-submit jobs to the ConceptEV v2 API on the dev environment. + +This example reads a list of component combinations from a CSV file and, for +each combination, creates a new concept on the server, assembles it with the +chosen components, and submits a job. The resulting concept IDs and job IDs +are written to an Excel file for later result retrieval. + +The example uses the ``conceptev_testing@ansys.com`` service account against +the dev ConceptEV environment. An ``examples/config.toml`` is provided with +all required settings. Before running, supply the account password via the +``CONCEPTEV_PASSWORD`` environment variable (or a file named +``conceptev_password`` in the working directory). + +The combinations CSV must contain a column per component role matching the +``component_order`` dictionary below, with component names as values. + +The ``base_concept_id`` is an existing concept on the dev server whose +components will be referenced when building each variant. +""" + +# %% +# Perform Required imports +# ------------------------ + +import datetime + +import pandas as pd + +from ansys.conceptev.core import app +from ansys.conceptev.core.app import get_conceptev_client +from ansys.conceptev.core.generated.api.concept_v2 import ( + create_concept, + create_concept_part, + create_job, + delete_concept, + get_concept, +) +from ansys.conceptev.core.generated.models import ArchitectureInput, ConceptInput +from ansys.conceptev.core.generated.models.job_request import JobRequest + +# %% +# Set up inputs +# ------------- +# Change the following variables to match your data. +# ``base_concept_id`` must be the ID of an existing concept on the dev server +# whose components are referenced in the combinations file. + +filename = "resources/combinations.csv" # See example file for format. +base_concept_id = "2465235f-ad2e-4923-9125-e2e69ccf5816" # Existing concept on the dev server. +component_order = { + "front_transmission_id": "Front Transmission", + "front_motor_id": "Front Motor", + "rear_transmission_id": "Rear Transmission", + "rear_motor_id": "Rear Motor", + "battery_id": "Battery", +} + +# %% +# Obtain account ID +# ----------------- +# The account ID is required when submitting jobs to the v2 API. + +with app.get_http_client() as http_client: + token = app.get_token(http_client) + account_id = app.get_account_id(token) + print(f"Using account ID: {account_id}") + + +# %% +# Helper: build a component name → ID map from a concept +# ------------------------------------------------------- + + +def get_component_id_map(concept) -> dict: + """Return {component_name: component_id} from a ConceptOutput.""" + result = {} + if concept.components: + for comp in concept.components: + result[comp.name] = comp.id + return result + + +# %% +# Load the base concept and validate the combinations file +# -------------------------------------------------------- + +combinations = pd.read_csv(filename, na_filter=False).to_dict("records") + +required_columns = set(component_order.values()) +file_columns = set(combinations[0].keys()) if combinations else set() +assert ( + required_columns <= file_columns +), f"Missing columns in combinations file: {required_columns - file_columns}" + +with get_conceptev_client() as client: + base_concept = get_concept.sync(id=base_concept_id, client=client) + base_component_map = get_component_id_map(base_concept) + + combo_component_names = {v for row in combinations for v in row.values() if v} + assert combo_component_names <= set(base_component_map.keys()), ( + f"Unknown components in combinations: " + f"{combo_component_names - set(base_component_map.keys())}" + ) + + requirement_ids = [r.id for r in (base_concept.requirements or [])] + + # %% + # Submit jobs for each combination + # --------------------------------- + + created_designs = [] + for combo in combinations: + title = ( + f"FM_{combo['Front Motor']}_RM_{combo['Rear Motor']}_" + f"{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}" + ) + try: + concept = create_concept.sync( + client=client, + body=ConceptInput(name=title), + ) + concept_id = concept.id + + arch_kwargs = { + field: base_component_map[combo[label]] + for field, label in component_order.items() + if combo.get(label) + } + battery_id = arch_kwargs.pop("battery_id") + created_arch = create_concept_part.sync( + id=concept_id, + part_type="architecture", + client=client, + body=ArchitectureInput( + battery_id=battery_id, + number_of_front_wheels=( + base_concept.architectures[0].number_of_front_wheels + if base_concept.architectures + else 2 + ), + number_of_front_motors=( + base_concept.architectures[0].number_of_front_motors + if base_concept.architectures + else 1 + ), + number_of_rear_wheels=( + base_concept.architectures[0].number_of_rear_wheels + if base_concept.architectures + else 2 + ), + number_of_rear_motors=( + base_concept.architectures[0].number_of_rear_motors + if base_concept.architectures + else 0 + ), + **arch_kwargs, + ), + ) + + job_record = create_job.sync( + concept_id=concept_id, + client=client, + body=JobRequest( + name=f"bulk_job: {title}", + account_id=account_id, + requirement_ids=requirement_ids, + architecture_id=created_arch.id, + ), + ) + print(f"Submitted job {job_record.id} for concept {concept_id} ({title})") + + created_designs.append( + { + "Title": title, + "Concept ID": concept_id, + "Architecture ID": created_arch.id, + "Job ID": job_record.id, + } + ) + except Exception as err: + print(f"Failed for combination {combo}: {err}") + continue + +# %% +# Save the list of created designs to a file +# ------------------------------------------ + +all_results = pd.DataFrame(created_designs) +all_results.to_excel("created_designs.xlsx", index=False) +print(f"Saved {len(created_designs)} designs to created_designs.xlsx") + +# %% +# Clean up: delete all created concepts +# -------------------------------------- +# +# .. warning:: +# This permanently removes all concepts created above from the dev server. +# Comment out this section if you want to keep them. + +with get_conceptev_client() as client: + for design in created_designs: + delete_concept.sync(id=design["Concept ID"], client=client) + print(f"Deleted concept {design['Concept ID']}") + print("Cleanup complete.") diff --git a/examples/config.toml b/examples/config.toml index 0fb3376f..ffcd130e 100644 --- a/examples/config.toml +++ b/examples/config.toml @@ -1,9 +1,12 @@ +# Production configuration for the v1 API examples (01–03). +# The password for conceptev_testing@ansys.com must be supplied via the +# CONCEPTEV_PASSWORD environment variable or a local 'conceptev_password' file. OCM_URL = "https://prod.portal.onscale.com/api" OCM_SOCKET_URL = "wss://sockets.prod.portal.onscale.com/socket" CONCEPTEV_URL = "https://conceptev.ansys.com/api" -client_id = '515a5511-a53c-45d9-a41a-93979f132c0b' -authority = 'https://ansysaccount.b2clogin.com/ansysaccount.onmicrosoft.com/B2C_1A_ANSYSID_SIGNUP_SIGNIN_TEST' -scope ='https://ansysaccount.onmicrosoft.com/AnsysID/Authentication' +client_id = "515a5511-a53c-45d9-a41a-93979f132c0b" +authority = "https://ansysaccount.b2clogin.com/ansysaccount.onmicrosoft.com/B2C_1A_ANSYSID_SIGNUP_SIGNIN_TEST" +scope = "https://ansysaccount.onmicrosoft.com/AnsysID/Authentication" conceptev_username = "conceptev_testing@ansys.com" account_name = "Burst Test Account 3 - PROD" -job_timeout= 3600 \ No newline at end of file +job_timeout = 3600 diff --git a/examples/project_results.json b/examples/project_results.json new file mode 100644 index 00000000..785a8726 --- /dev/null +++ b/examples/project_results.json @@ -0,0 +1,14 @@ +[ + { + "concept_id": "1ccba31c-dcd5-48dd-8d19-24ca26d0853a", + "concept_name": "Example Concept A", + "job_id": "job-001", + "results": null + }, + { + "concept_id": "6561464a-fc83-4fea-8fbd-45a37486fd2b", + "concept_name": "Example Concept B", + "job_id": "job-002", + "results": null + } +] diff --git a/openapi.json b/openapi.json new file mode 100644 index 00000000..d735d223 --- /dev/null +++ b/openapi.json @@ -0,0 +1,6468 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "ConceptEV-API", + "summary": "API Endpoint documentation for ConceptEV", + "version": "0.2.158" + }, + "paths": { + "/v2/concept/{concept_id}/job/availability": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Check Job Backend Availability", + "description": "Check if job backend is available.", + "operationId": "check_job_backend_availability_v2_concept__concept_id__job_availability_get", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Response Check Job Backend Availability V2 Concept Concept Id Job Availability Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{concept_id}/job": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Jobs List", + "description": "Retrieve list of jobs.", + "operationId": "get_jobs_list_v2_concept__concept_id__job_get", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JobOutput" + }, + "title": "Response Get Jobs List V2 Concept Concept Id Job Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Job", + "description": "Create a new requirement job.\n\nStores an initial RUNNING ConceptJobRecord in the concept immediately\n(as a PartType.JOB part), then updates it with the output URL once the\nsolver finishes. Returns the stored record so the caller has the part id.", + "operationId": "create_job_v2_concept__concept_id__job_post", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptJobRecord" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{concept_id}/job/{job_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Job", + "description": "Retrieve job status.", + "operationId": "get_job_v2_concept__concept_id__job__job_id__get", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobOutput" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Job", + "description": "Delete a job from the backend.", + "operationId": "delete_job_v2_concept__concept_id__job__job_id__delete", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{concept_id}/job/{job_id}/files/{file_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Job File", + "description": "Retrieve a job output file.\n\nFor local backends the file bytes are streamed directly. For remote\nbackends (e.g. HPS/S3) a 307 redirect to a presigned download URL is\nreturned instead.", + "operationId": "get_job_file_v2_concept__concept_id__job__job_id__files__file_id__get", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Concept", + "description": "Get a concept by ID from the database.", + "operationId": "get_concept_v2_concept__id__get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update Concept", + "description": "Update an existing concept in the database.", + "operationId": "update_concept_v2_concept__id__put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Concept", + "description": "Delete a concept from the database.", + "operationId": "delete_concept_v2_concept__id__delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Concept", + "description": "Create a new concept in the database.", + "operationId": "create_concept_v2_concept_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptInput" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/save": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Save Concept", + "description": "Save a concept to a specified file path (filesystem backend only).\n\nCopies the ``.cev`` archive to the given path, re-registers the concept\nat that location, and sets ``save_state`` to ``SaveState.SAVED``.", + "operationId": "save_concept_v2_concept__id__save_post", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSaveRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/files/{file_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get File", + "description": "Get file metadata for a concept.", + "operationId": "get_file_v2_concept__id__files__file_id__get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update File", + "description": "Update an existing file for a concept.", + "operationId": "update_file_v2_concept__id__files__file_id__put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete File", + "description": "Delete a file from a concept.", + "operationId": "delete_file_v2_concept__id__files__file_id__delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/files": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create File", + "description": "Upload a new file for a concept.", + "operationId": "create_file_v2_concept__id__files_post", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + }, + { + "name": "component_file_type", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ComponentFileType" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_file_v2_concept__id__files_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemCreateResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/{part_type}/{part_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Concept Part", + "description": "Get a specific part from a concept.", + "operationId": "get_concept_part_v2_concept__id___part_type___part_id__get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Get Concept Part V2 Concept Id Part Type Part Id Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update Concept Part", + "description": "Update an existing part within a concept.", + "operationId": "update_concept_part_v2_concept__id___part_type___part_id__put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabInput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureInput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleInput" + } + ], + "title": "Part" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Update Concept Part V2 Concept Id Part Type Part Id Put" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Concept Part", + "description": "Delete a part from a concept.", + "operationId": "delete_concept_part_v2_concept__id___part_type___part_id__delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/{part_type}": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Concept Part", + "description": "Create a new part within a concept.", + "operationId": "create_concept_part_v2_concept__id___part_type__post", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabInput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureInput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleInput" + } + ], + "title": "Part" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Create Concept Part V2 Concept Id Part Type Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept:open": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Open Concept", + "description": "Open a .cev concept file and load it into the file-system database.\n\nReads the concept ID from inside the file so the filename can be any\nhuman-readable name rather than the UUID. Registers the path so all\nsubsequent operations resolve the correct location without requiring\nanother open call. Multiple files in different directories can be\nregistered independently.\n\nNote: This endpoint is only meaningful when the file-system backend is\nactive. It is registered unconditionally so the route exists regardless\nof which backend was configured at import time (important for tests that\nswap configs via fixtures).", + "operationId": "open_concept_v2_concept_open_post", + "parameters": [ + { + "name": "path_to_file", + "in": "query", + "required": true, + "schema": { + "type": "string", + "format": "path", + "title": "Path To File" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/component/{part_id}:get_display_data": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Get Display Data", + "description": "Get graph data for a component.\n\nSupported component types:\n\n- **MotorLab** \u2014 returns ``LossMapGridLab`` or ``LossMapGridPower``\n- **BatteryLookupTable** \u2014 returns ``BatteryLookupTableData``\n- **TransmissionLossCoefficients** \u2014 returns ``LossMapGridTorque``\n\nArgs:\n id: The concept ID.\n part_id: The component part ID.\n database: Injected database dependency.\n unit_choices: Injected unit-choice dependency.\n extra_args: Optional loss-map calculation arguments (speed, voltage\u2026).\n\nReturns:\n A display-data object in user units.\n\nRaises:\n HTTPException 404: If the component or its associated file is not found.\n HTTPException 422: If the component type does not support display data.", + "operationId": "get_display_data_v2_concept__id__component__part_id__get_display_data_post", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/LossMapGridLab" + }, + { + "$ref": "#/components/schemas/LossMapGridPower" + }, + {} + ], + "title": "Response Get Display Data V2 Concept Id Component Part Id Get Display Data Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}:calculate_forces": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Calculate Total Forces", + "description": "Calculate the total tractive torque.", + "operationId": "calculate_total_forces_v2_concept__id__calculate_forces_post", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraphInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraphOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/unit_choices": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_unit_choices_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + } + } + }, + "put": { + "tags": [ + "Unit Choices" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_unit_choices_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "post": { + "tags": [ + "Unit Choices" + ], + "summary": "Create Unit Choices", + "description": "Create.", + "operationId": "create_unit_choices_unit_choices_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "delete": { + "tags": [ + "Unit Choices" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_unit_choices_delete", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/unit_choices/info": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Get Info", + "description": "Get table of units for frontend generation.", + "operationId": "get_info_unit_choices_info_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Get Info Unit Choices Info Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + } + }, + "components": { + "schemas": { + "AccelerationUnit": { + "type": "string", + "enum": [ + "m/s\u00b2", + "km/hr/s", + "mph/s" + ], + "title": "AccelerationUnit", + "description": "Acceleration Unit." + }, + "Aero": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + } + }, + "type": "object", + "title": "Aero", + "description": "Aero Configuration." + }, + "AeroInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "AeroInput", + "description": "Aero Input." + }, + "AeroOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "AeroOutput", + "description": "Aero Output." + }, + "AngleUnit": { + "type": "string", + "enum": [ + "rad", + "deg", + "%" + ], + "title": "AngleUnit", + "description": "Unit of Angle." + }, + "AngularAccelerationUnit": { + "type": "string", + "enum": [ + "rad/s\u00b2", + "rpm/s", + "rps/s", + "deg/s\u00b2" + ], + "title": "AngularAccelerationUnit", + "description": "Angular Acceleration Unit." + }, + "AngularSpeedUnit": { + "type": "string", + "enum": [ + "rad/s", + "rpm", + "rps", + "deg/s" + ], + "title": "AngularSpeedUnit", + "description": "Angular Speed Unit." + }, + "ArchitectureInput": { + "properties": { + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 2 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 2 + }, + "battery": { + "type": "null", + "title": "Battery" + }, + "front_transmission": { + "type": "null", + "title": "Front Transmission" + }, + "front_motor": { + "type": "null", + "title": "Front Motor" + }, + "front_inverter": { + "type": "null", + "title": "Front Inverter" + }, + "front_clutch": { + "type": "null", + "title": "Front Clutch" + }, + "rear_transmission": { + "type": "null", + "title": "Rear Transmission" + }, + "rear_motor": { + "type": "null", + "title": "Rear Motor" + }, + "rear_inverter": { + "type": "null", + "title": "Rear Inverter" + }, + "rear_clutch": { + "type": "null", + "title": "Rear Clutch" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "part_type": { + "type": "string", + "const": "architecture", + "title": "Part Type", + "default": "architecture" + } + }, + "type": "object", + "required": [ + "battery_id" + ], + "title": "ArchitectureInput", + "description": "Architecture Input." + }, + "ArchitectureOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 2 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 2 + }, + "battery": { + "type": "null", + "title": "Battery" + }, + "front_transmission": { + "type": "null", + "title": "Front Transmission" + }, + "front_motor": { + "type": "null", + "title": "Front Motor" + }, + "front_inverter": { + "type": "null", + "title": "Front Inverter" + }, + "front_clutch": { + "type": "null", + "title": "Front Clutch" + }, + "rear_transmission": { + "type": "null", + "title": "Rear Transmission" + }, + "rear_motor": { + "type": "null", + "title": "Rear Motor" + }, + "rear_inverter": { + "type": "null", + "title": "Rear Inverter" + }, + "rear_clutch": { + "type": "null", + "title": "Rear Clutch" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "part_type": { + "type": "string", + "const": "architecture", + "title": "Part Type", + "default": "architecture" + }, + "components_cost": { + "type": "number", + "title": "Components Cost", + "default": 0 + }, + "components_mass": { + "type": "number", + "title": "Components Mass", + "default": 0 + }, + "max_wheel_speed": { + "type": "number", + "title": "Max Wheel Speed", + "default": 0 + } + }, + "type": "object", + "required": [ + "id", + "battery_id" + ], + "title": "ArchitectureOutput", + "description": "Architecture Output." + }, + "AreaUnit": { + "type": "string", + "enum": [ + "m\u00b2", + "mm\u00b2", + "cm\u00b2", + "in\u00b2", + "ft\u00b2", + "yd\u00b2" + ], + "title": "AreaUnit", + "description": "Area Unit." + }, + "BatteryConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "battery", + "title": "Component Config Type", + "default": "battery" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryConfiguration", + "description": "Configuration that can change characteristics of the battery." + }, + "BatteryFixedVoltagesInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "title": "BatteryFixedVoltagesInput", + "description": "Battery Fixed Voltages Input." + }, + "BatteryFixedVoltagesOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "BatteryFixedVoltagesOutput", + "description": "Battery Fixed Voltages Output." + }, + "BatteryLookupTableData": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableData", + "description": "Data for a lookup table battery." + }, + "BatteryLookupTableInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTableInput", + "description": "Battery Lookup Table Input." + }, + "BatteryLookupTableOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id", + "lookup_table" + ], + "title": "BatteryLookupTableOutput", + "description": "Battery Lookup Table Output." + }, + "BatteryState": { + "properties": { + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Temperature" + } + }, + "type": "object", + "title": "BatteryState", + "description": "Variables that define state of a battery." + }, + "Body_create_file_v2_concept__id__files_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_file_v2_concept__id__files_post" + }, + "ComponentAxle": { + "type": "string", + "enum": [ + "Front", + "Rear", + "None" + ], + "title": "ComponentAxle", + "description": "Component axle." + }, + "ComponentConfigurationSet": { + "properties": { + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Configurations" + } + }, + "type": "object", + "title": "ComponentConfigurationSet", + "description": "Set of component configurations." + }, + "ComponentFileType": { + "type": "string", + "enum": [ + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "transmission_torque_grid_file", + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "thermal_model_file" + ], + "title": "ComponentFileType", + "description": "Types of files." + }, + "ComponentLossMapArgs": { + "properties": { + "voltage": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage" + }, + "gear_ratio": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Gear Ratio" + }, + "speed": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Speed" + }, + "dc_current": { + "type": "number", + "title": "Dc Current", + "default": 50 + }, + "power_factor": { + "type": "number", + "title": "Power Factor", + "default": 1 + }, + "phase_current_max": { + "type": "number", + "title": "Phase Current Max", + "default": 400 + }, + "frequency": { + "type": "number", + "title": "Frequency", + "default": 1000 + } + }, + "type": "object", + "title": "ComponentLossMapArgs", + "description": "Args for create component loss maps.\n\nAllows unit transforming." + }, + "ConceptInput": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "file_items": { + "items": { + "$ref": "#/components/schemas/FileItemOutput" + }, + "type": "array", + "title": "File Items", + "default": [] + }, + "components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "MotorLabModel": "#/components/schemas/MotorLabInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + "type": "array", + "title": "Components", + "default": [] + }, + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + "type": "array", + "title": "Configurations", + "default": [] + }, + "architectures": { + "items": { + "$ref": "#/components/schemas/ArchitectureInput" + }, + "type": "array", + "title": "Architectures", + "default": [] + }, + "requirements": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + "type": "array", + "title": "Requirements", + "default": [] + }, + "drive_cycles": { + "items": { + "$ref": "#/components/schemas/DriveCycleInput" + }, + "type": "array", + "title": "Drive Cycles", + "default": [] + } + }, + "type": "object", + "title": "ConceptInput", + "description": "Concept input \u2014 uses input variants of each part group." + }, + "ConceptJobRecord": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "job", + "title": "Part Type", + "default": "job" + }, + "name": { + "type": "string", + "title": "Name" + }, + "status": { + "type": "string", + "title": "Status", + "default": "RUNNING" + }, + "output_urls": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Output Urls", + "default": [] + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + } + }, + "type": "object", + "required": [ + "id", + "name" + ], + "title": "ConceptJobRecord", + "description": "A job record stored as a part inside a concept.\n\nTracks backend job status and the output file URLs written by the solver.\nStored under PartType.JOB so it uses the same CRUD path as all other parts." + }, + "ConceptOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "file_items": { + "items": { + "$ref": "#/components/schemas/FileItemOutput" + }, + "type": "array", + "title": "File Items", + "default": [] + }, + "id": { + "type": "string", + "title": "Id" + }, + "save_state": { + "$ref": "#/components/schemas/SaveState", + "default": "saved" + }, + "components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + "type": "array", + "title": "Components", + "default": [] + }, + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + "type": "array", + "title": "Configurations", + "default": [] + }, + "architectures": { + "items": { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + "type": "array", + "title": "Architectures", + "default": [] + }, + "requirements": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + "type": "array", + "title": "Requirements", + "default": [] + }, + "drive_cycles": { + "items": { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + "type": "array", + "title": "Drive Cycles", + "default": [] + }, + "jobs": { + "items": { + "$ref": "#/components/schemas/ConceptJobRecord" + }, + "type": "array", + "title": "Jobs", + "default": [] + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "ConceptOutput", + "description": "Concept output with database ID \u2014 uses output variants of each part group." + }, + "ConceptSaveRequest": { + "properties": { + "path": { + "type": "string", + "title": "Path" + } + }, + "type": "object", + "required": [ + "path" + ], + "title": "ConceptSaveRequest", + "description": "Request body for the save-concept endpoint." + }, + "CurrentUnit": { + "type": "string", + "enum": [ + "A", + "mA", + "kA" + ], + "title": "CurrentUnit", + "description": "Current Unit." + }, + "DensityUnit": { + "type": "string", + "enum": [ + "kg/m\u00b3", + "g/cm\u00b3" + ], + "title": "DensityUnit", + "description": "Density Unit." + }, + "DriveCycleInput": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": {}, + "type": "array", + "title": "Points" + }, + "part_type": { + "type": "string", + "const": "drive_cycle", + "title": "Part Type", + "default": "drive_cycle" + }, + "drive_cycle_data_id": { + "type": "string", + "title": "Drive Cycle Data Id" + } + }, + "type": "object", + "required": [ + "drive_cycle_data_id" + ], + "title": "DriveCycleInput", + "description": "Drive Cycle Input.\n\nUpload the raw drive cycle data (CSV or JSON export from the solver) as a\nfile first, then create a ``DriveCycleInput`` referencing that file via\n``drive_cycle_data_id``. The ``points`` field is excluded from storage." + }, + "DriveCycleOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": {}, + "type": "array", + "title": "Points" + }, + "part_type": { + "type": "string", + "const": "drive_cycle", + "title": "Part Type", + "default": "drive_cycle" + }, + "drive_cycle_data_id": { + "type": "string", + "title": "Drive Cycle Data Id" + } + }, + "type": "object", + "required": [ + "id", + "drive_cycle_data_id" + ], + "title": "DriveCycleOutput", + "description": "Drive Cycle Output.\n\nThe raw time-series data (``points``) is stored in a separate file\nreferenced by ``drive_cycle_data_id``, mirroring the pattern used by\n:class:`~src.v2.models.components.MotorLabOutput`. The ``points`` field\nis excluded from the concept record so that large point arrays do not bloat\nthe concept JSON." + }, + "DriveCycleRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "title": "Drive Cycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementInput", + "description": "Drive Cycle Requirement Input." + }, + "DriveCycleRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "title": "Drive Cycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementOutput", + "description": "Drive Cycle Requirement Output." + }, + "DynamicRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "requirement_input_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Input Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementInput", + "description": "Dynamic Requirement Input." + }, + "DynamicRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "requirement_input_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Input Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementOutput", + "description": "Dynamic Requirement Output." + }, + "Edge": { + "properties": { + "resistance": { + "type": "number", + "title": "Resistance" + }, + "connected_node_list": { + "items": {}, + "type": "array", + "title": "Connected Node List" + } + }, + "type": "object", + "required": [ + "resistance" + ], + "title": "Edge" + }, + "ElectricChargeUnit": { + "type": "string", + "enum": [ + "A\u00b7s" + ], + "title": "ElectricChargeUnit", + "description": "Unit of Electrical Charge." + }, + "ElectricalEnergyUnit": { + "type": "string", + "enum": [ + "J", + "kWh", + "VA\u00b7hr", + "Wh" + ], + "title": "ElectricalEnergyUnit", + "description": "Unit of Electrical Energy." + }, + "ElectricalPowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "VA", + "kVA" + ], + "title": "ElectricalPowerUnit", + "description": "Unit of Electrical Power." + }, + "EnergyUnit": { + "type": "string", + "enum": [ + "J", + "kJ", + "MJ", + "mJ", + "Wh", + "kWh" + ], + "title": "EnergyUnit", + "description": "Energy Unit." + }, + "FileInfo": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "path": { + "type": "string", + "title": "Path" + } + }, + "type": "object", + "required": [ + "id", + "path" + ], + "title": "FileInfo", + "description": "File data model." + }, + "FileItemCreateResponse": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + }, + "calculated_values": { + "additionalProperties": true, + "type": "object", + "title": "Calculated Values", + "default": {} + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemCreateResponse", + "description": "Response from creating a file item.\n\nIncludes any calculated values extracted from the file." + }, + "FileItemInput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemInput", + "description": "File Item Input \u2014 metadata supplied when registering a stored file." + }, + "FileItemOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemOutput", + "description": "File Item." + }, + "ForceUnit": { + "type": "string", + "enum": [ + "N", + "lbf", + "dyn" + ], + "title": "ForceUnit", + "description": "Force Unit." + }, + "FrequencyUnit": { + "type": "string", + "enum": [ + "Hz" + ], + "title": "FrequencyUnit", + "description": "Unit of frequency." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InertiaUnit": { + "type": "string", + "enum": [ + "kg\u00b7m\u00b2", + "g\u00b7mm\u00b2" + ], + "title": "InertiaUnit", + "description": "Inertia Unit." + }, + "JobOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + }, + "status": { + "type": "string", + "title": "Status" + }, + "files": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/FileInfo" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Files" + } + }, + "type": "object", + "required": [ + "name", + "id", + "status" + ], + "title": "JobOutput", + "description": "Job result data model." + }, + "JobRequest": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "requirement_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirement Ids" + }, + "architecture_id": { + "type": "string", + "title": "Architecture Id" + }, + "version": { + "type": "string", + "title": "Version", + "default": "latest" + } + }, + "type": "object", + "required": [ + "name", + "requirement_ids", + "architecture_id" + ], + "title": "JobRequest", + "description": "Request body for creating a job." + }, + "LengthUnit": { + "type": "string", + "enum": [ + "m", + "mm", + "cm", + "in", + "ft", + "yd", + "km", + "miles" + ], + "title": "LengthUnit", + "description": "Length Unit." + }, + "LossMapGridLab": { + "properties": { + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "phase_advances": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Phase Advances" + }, + "slips": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Slips" + }, + "losses_total": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses Total" + }, + "losses_iron": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses Iron" + } + }, + "type": "object", + "required": [ + "currents", + "phase_advances", + "slips", + "losses_total", + "losses_iron" + ], + "title": "LossMapGridLab", + "description": "Used for Lab motors if no efficiency map included in the .lab file.\n\nLosses for plotted with current/phase advance or current/slip." + }, + "LossMapGridPower": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "powers": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Powers" + }, + "meta_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/LossMapGridPowerMetaData" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "losses", + "efficiencies", + "powers" + ], + "title": "LossMapGridPower", + "description": "Power losses (e.g. motors)." + }, + "LossMapGridPowerMetaData": { + "properties": { + "voltage": { + "type": "number", + "title": "Voltage" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + }, + "current_limit_line_peak": { + "type": "number", + "title": "Current Limit Line Peak" + }, + "stator_temperature": { + "type": "number", + "title": "Stator Temperature" + }, + "rotor_temperature": { + "type": "number", + "title": "Rotor Temperature" + } + }, + "type": "object", + "required": [ + "voltage", + "control_strategy_bpm", + "control_strategy_sync", + "current_limit_line_peak", + "stator_temperature", + "rotor_temperature" + ], + "title": "LossMapGridPowerMetaData", + "description": "Meta-data for efficiency maps that have been calculated in Lab." + }, + "Mass": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + } + }, + "type": "object", + "title": "Mass", + "description": "Mass Configuration." + }, + "MassInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "MassInput", + "description": "Mass Input." + }, + "MassOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "MassOutput", + "description": "Mass Output." + }, + "MassUnit": { + "type": "string", + "enum": [ + "kg", + "g", + "lb", + "oz", + "t", + "LT", + "tn" + ], + "title": "MassUnit", + "description": "Mass Unit." + }, + "MotorConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "motor", + "title": "Component Config Type", + "default": "motor" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "state": { + "$ref": "#/components/schemas/MotorState", + "default": {} + } + }, + "type": "object", + "title": "MotorConfiguration", + "description": "Configuration that can change characteristics of the motor." + }, + "MotorLabData": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabData", + "description": "Motor Lab Data.\n\nModel is held as a dict, exported from Lab." + }, + "MotorLabInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/MotorLabData" + }, + { + "type": "null" + } + ] + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModel" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + }, + "lab_data_id": { + "type": "string", + "title": "Lab Data Id" + } + }, + "type": "object", + "required": [ + "max_speed", + "lab_data_id" + ], + "title": "MotorLabInput", + "description": "Motor Lab Input." + }, + "MotorLabOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/MotorLabData" + }, + { + "type": "null" + } + ] + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModel" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + }, + "lab_data_id": { + "type": "string", + "title": "Lab Data Id" + } + }, + "type": "object", + "required": [ + "id", + "max_speed", + "lab_data_id" + ], + "title": "MotorLabOutput", + "description": "Motor Lab Output." + }, + "MotorState": { + "properties": { + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "stator_winding_temp_peak": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp Peak" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "airgap_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Airgap Temp" + }, + "bearing_temp_front": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Front" + }, + "bearing_temp_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Rear" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + } + }, + "type": "object", + "title": "MotorState", + "description": "Variables that define state of a motor.\n\nEssentially these are mostly all inputs to a Lab operating point calculation." + }, + "MotorThermalLimits": { + "properties": { + "stator": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator" + }, + "rotor": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor" + }, + "stator_limit_type": { + "type": "string", + "title": "Stator Limit Type", + "default": "average" + } + }, + "type": "object", + "title": "MotorThermalLimits", + "description": "Thermal limits for motor components." + }, + "Node": { + "properties": { + "uid": { + "type": "integer", + "title": "Uid" + }, + "name": { + "type": "string", + "title": "Name" + }, + "capacitance": { + "type": "number", + "title": "Capacitance", + "default": 0 + }, + "fixed_temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Fixed Temperature" + } + }, + "type": "object", + "required": [ + "uid", + "name" + ], + "title": "Node" + }, + "PartType": { + "type": "string", + "enum": [ + "component", + "configuration", + "requirement", + "job", + "architecture", + "drive_cycle" + ], + "title": "PartType", + "description": "Part type enum." + }, + "PowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "mW", + "MW", + "hp", + "hp" + ], + "title": "PowerUnit", + "description": "Power Unit." + }, + "PressureUnit": { + "type": "string", + "enum": [ + "Pa", + "kPa", + "MPa", + "psi" + ], + "title": "PressureUnit", + "description": "Pressure Unit." + }, + "RatioUnit": { + "type": "string", + "enum": [ + "", + "%" + ], + "title": "RatioUnit", + "description": "Ratio Unit." + }, + "ResistanceUnit": { + "type": "string", + "enum": [ + "ohm" + ], + "title": "ResistanceUnit", + "description": "Resistance Unit." + }, + "RoadEfficiencyUnit": { + "type": "string", + "enum": [ + "m/J", + "km/kWh", + "miles/kWh", + "MPGe" + ], + "title": "RoadEfficiencyUnit", + "description": "Unit of Road Efficiency." + }, + "SaveState": { + "type": "string", + "enum": [ + "unsaved", + "saved" + ], + "title": "SaveState", + "description": "Persistence state of a concept on the filesystem.\n\n``UNSAVED`` \u2014 concept was created in this session and has never been\nwritten to a user-chosen path (the default for new concepts).\n\n``SAVED`` \u2014 concept has been explicitly saved to a known path.\n\nExtending example: add ``MODIFIED`` here when tracking unsaved edits\nto an already-saved concept (\"dirty\" state)." + }, + "SpeedUnit": { + "type": "string", + "enum": [ + "m/s", + "km/hr", + "mph", + "ft/s" + ], + "title": "SpeedUnit", + "description": "Speed Unit." + }, + "StaticRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "speed": { + "type": "number", + "title": "Speed", + "default": 10 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "requirement_input_type": { + "type": "string", + "const": "static", + "title": "Requirement Input Type", + "default": "static" + }, + "acceleration": { + "type": "number", + "title": "Acceleration", + "default": 1 + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "StaticRequirementInput", + "description": "Static Requirement (Acceleration) Input." + }, + "StaticRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "requirement_input_type": { + "type": "string", + "const": "static", + "title": "Requirement Input Type", + "default": "static" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id", + "speed", + "acceleration" + ], + "title": "StaticRequirementOutput", + "description": "Static Requirement (Acceleration) Output." + }, + "SurfaceConditionTractionConfigs": { + "type": "string", + "enum": [ + "Snow", + "Wet", + "Dry" + ], + "title": "SurfaceConditionTractionConfigs", + "description": "Surface conditions that affect the traction coefficient." + }, + "TemperatureUnit": { + "type": "string", + "enum": [ + "K", + "\u00b0C", + "\u00b0F" + ], + "title": "TemperatureUnit", + "description": "Temperature Unit." + }, + "ThermalModel": { + "properties": { + "component_file_type": { + "type": "string", + "const": "ThermalModel", + "title": "Component File Type", + "default": "ThermalModel" + }, + "network": { + "$ref": "#/components/schemas/ThermalNetwork" + }, + "loss_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Loss Map" + }, + "temperature_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Temperature Map" + } + }, + "type": "object", + "required": [ + "network", + "loss_map", + "temperature_map" + ], + "title": "ThermalModel", + "description": "Thermal model.\n\nContains the thermal network defined by nodes and edges, and mappings of which nodes\ncorrespond to which losses and temperatures." + }, + "ThermalNetwork": { + "properties": { + "edges": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/Edge" + }, + "type": "array" + }, + "type": "object", + "title": "Edges" + }, + "nodes": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/Node" + }, + "type": "array" + }, + "type": "object", + "title": "Nodes" + }, + "speed_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Speed Dict" + }, + "flow_rate_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Flow Rate Dict" + } + }, + "type": "object", + "required": [ + "edges", + "nodes", + "speed_dict", + "flow_rate_dict" + ], + "title": "ThermalNetwork", + "description": "Lumped parameter thermal network.\n\nIt is constructed from sets of nodes and edges (connections) at different speeds\nand flow rates.\n\nFields:\n speed_dict (dict): Dictionary mapping indices to speed values.\n flow_rate_dict (dict): Dictionary mapping indices to flow rate values.\n edges (dict): Dictionary mapping indices to edge lists.\n nodes (dict): Dictionary mapping indices to node lists." + }, + "TimeUnit": { + "type": "string", + "enum": [ + "s", + "ms", + "min", + "hr" + ], + "title": "TimeUnit", + "description": "Time Unit." + }, + "TorqueUnit": { + "type": "string", + "enum": [ + "N\u00b7m", + "ft\u00b7lbf", + "kN\u00b7m", + "MN\u00b7m", + "dyn\u00b7cm" + ], + "title": "TorqueUnit", + "description": "Torque Unit." + }, + "TotalTractiveTorqueGraphInput": { + "properties": { + "max_speed": { + "type": "number", + "exclusiveMinimum": 0.0, + "title": "Max Speed" + }, + "step_size_speed": { + "type": "number", + "exclusiveMinimum": 0.0, + "title": "Step Size Speed" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "mass": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mass" + }, + { + "type": "null" + } + ] + }, + "aero": { + "anyOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "type": "null" + } + ] + }, + "wheel": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "type": "null" + } + ] + }, + "altitude": { + "type": "number", + "title": "Altitude" + }, + "headwind": { + "type": "number", + "title": "Headwind" + }, + "gradient": { + "type": "number", + "title": "Gradient" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + } + }, + "type": "object", + "required": [ + "max_speed", + "step_size_speed", + "acceleration", + "altitude", + "headwind", + "gradient", + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "TotalTractiveTorqueGraphInput", + "description": "Total Tractive Torque Graph Input." + }, + "TotalTractiveTorqueGraphOutput": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "total_tractive_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Torques" + }, + "aero_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Aero Forces" + }, + "mass_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Mass Forces" + }, + "total_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Forces" + }, + "total_tractive_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Powers" + } + }, + "type": "object", + "required": [ + "speeds", + "acceleration", + "total_tractive_torques", + "aero_forces", + "mass_forces", + "total_forces", + "total_tractive_powers" + ], + "title": "TotalTractiveTorqueGraphOutput", + "description": "Total Tractive Torque Graph Output." + }, + "TransmissionLossCoefficientsInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "title": "TransmissionLossCoefficientsInput", + "description": "Transmission Loss Coefficients Input." + }, + "TransmissionLossCoefficientsOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "TransmissionLossCoefficientsOutput", + "description": "Transmission Loss Coefficients Output." + }, + "UnitChoices": { + "properties": { + "unit_type_to_unit_map": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/MassUnit" + }, + { + "$ref": "#/components/schemas/TimeUnit" + }, + { + "$ref": "#/components/schemas/ForceUnit" + }, + { + "$ref": "#/components/schemas/TorqueUnit" + }, + { + "$ref": "#/components/schemas/TemperatureUnit" + }, + { + "$ref": "#/components/schemas/LengthUnit" + }, + { + "$ref": "#/components/schemas/AreaUnit" + }, + { + "$ref": "#/components/schemas/VolumeUnit" + }, + { + "$ref": "#/components/schemas/SpeedUnit" + }, + { + "$ref": "#/components/schemas/AccelerationUnit" + }, + { + "$ref": "#/components/schemas/AngularSpeedUnit" + }, + { + "$ref": "#/components/schemas/AngularAccelerationUnit" + }, + { + "$ref": "#/components/schemas/EnergyUnit" + }, + { + "$ref": "#/components/schemas/PowerUnit" + }, + { + "$ref": "#/components/schemas/DensityUnit" + }, + { + "$ref": "#/components/schemas/InertiaUnit" + }, + { + "$ref": "#/components/schemas/PressureUnit" + }, + { + "$ref": "#/components/schemas/RatioUnit" + }, + { + "$ref": "#/components/schemas/VoltageUnit" + }, + { + "$ref": "#/components/schemas/CurrentUnit" + }, + { + "$ref": "#/components/schemas/ResistanceUnit" + }, + { + "$ref": "#/components/schemas/ElectricChargeUnit" + }, + { + "$ref": "#/components/schemas/ElectricalEnergyUnit" + }, + { + "$ref": "#/components/schemas/ElectricalPowerUnit" + }, + { + "$ref": "#/components/schemas/AngleUnit" + }, + { + "$ref": "#/components/schemas/RoadEfficiencyUnit" + }, + { + "$ref": "#/components/schemas/FrequencyUnit" + }, + { + "$ref": "#/components/schemas/VolumetricFlowRateUnit" + } + ] + }, + "type": "object", + "title": "Unit Type To Unit Map", + "default": { + "mass": "kg", + "time": "s", + "force": "N", + "torque": "N\u00b7m", + "temperature": "\u00b0C", + "length": "m", + "distance": "km", + "area": "m\u00b2", + "volume": "m\u00b3", + "speed": "km/hr", + "acceleration": "m/s\u00b2", + "angular_speed": "rpm", + "angular_acceleration": "rps/s", + "energy": "J", + "power": "kW", + "density": "kg/m\u00b3", + "inertia": "kg\u00b7m\u00b2", + "pressure": "Pa", + "ratio": "%", + "voltage": "V", + "current": "A", + "resistance": "ohm", + "electric_charge": "A\u00b7s", + "electrical_energy": "kWh", + "electrical_power": "kW", + "gradient": "deg", + "road_efficiency": "km/kWh", + "frequency": "Hz", + "volumetric_flow_rate": "l/min" + } + } + }, + "type": "object", + "title": "UnitChoices", + "description": "Unit Choice for the analysis.\n\nWe might not need all of these.\nWe might want to create preset groups of these (eg. MKS, Imperial etc)" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "VoltageUnit": { + "type": "string", + "enum": [ + "V", + "mV", + "kV" + ], + "title": "VoltageUnit", + "description": "Voltage Unit." + }, + "VolumeUnit": { + "type": "string", + "enum": [ + "m\u00b3", + "mm\u00b3", + "cm\u00b3", + "in\u00b3", + "ft\u00b3", + "yd\u00b3", + "l", + "ml", + "cc" + ], + "title": "VolumeUnit", + "description": "Volume Unit." + }, + "VolumetricFlowRateUnit": { + "type": "string", + "enum": [ + "m\u00b3/s", + "m\u00b3/min", + "l/s", + "l/min" + ], + "title": "VolumetricFlowRateUnit", + "description": "Unit of volumetric flow rate." + }, + "WheelInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "WheelInput", + "description": "Wheel Input." + }, + "WheelOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "WheelOutput", + "description": "Wheel Output." + }, + "WheelRollingResistanceConfigs": { + "type": "string", + "enum": [ + "Car on asphalt", + "Car on concrete", + "Car on gravel" + ], + "title": "WheelRollingResistanceConfigs", + "description": "Condition on wheels which affect the rolling resistance coefficient." + } + }, + "securitySchemes": { + "APIKeyHeader": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "servers": [ + { + "url": "/api" + } + ] +} \ No newline at end of file diff --git a/schema/generated_client/.gitignore b/schema/generated_client/.gitignore new file mode 100644 index 00000000..79a2c3d7 --- /dev/null +++ b/schema/generated_client/.gitignore @@ -0,0 +1,23 @@ +__pycache__/ +build/ +dist/ +*.egg-info/ +.pytest_cache/ + +# pyenv +.python-version + +# Environments +.env +.venv + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# JetBrains +.idea/ + +/coverage.xml +/.coverage diff --git a/schema/generated_client/README.md b/schema/generated_client/README.md new file mode 100644 index 00000000..1f680c16 --- /dev/null +++ b/schema/generated_client/README.md @@ -0,0 +1,135 @@ +# conceptev-api-client +A client library for accessing ConceptEV-API + +## Usage +First, create a client: + +```python +from conceptev_api_client import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from conceptev_api_client import AuthenticatedClient + +client = AuthenticatedClient( + base_url="https://api.example.com", token="SuperSecretToken" +) +``` + +Now call your endpoint and use your models: + +```python +from conceptev_api_client.models import MyDataModel +from conceptev_api_client.api.my_tag import get_my_data_model +from conceptev_api_client.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from conceptev_api_client.models import MyDataModel +from conceptev_api_client.api.my_tag import get_my_data_model +from conceptev_api_client.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed( + client=client + ) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False, +) +``` + +Things to know: +1. Every path/method combo becomes a Python module with four functions: + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `conceptev_api_client.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from conceptev_api_client import Client + + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + + +def log_response(response): + request = response.request + print( + f"Response event hook: {request.method} {request.url} - Status {response.status_code}" + ) + + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from conceptev_api_client import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client( + httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030") +) +``` + +## Building / publishing this package +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/schema/generated_client/conceptev_api_client/__init__.py b/schema/generated_client/conceptev_api_client/__init__.py new file mode 100644 index 00000000..3943d584 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing ConceptEV-API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/schema/generated_client/conceptev_api_client/api/__init__.py b/schema/generated_client/conceptev_api_client/api/__init__.py new file mode 100644 index 00000000..81f9fa24 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/__init__.py b/schema/generated_client/conceptev_api_client/api/concept_v2/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/calculate_total_forces.py b/schema/generated_client/conceptev_api_client/api/concept_v2/calculate_total_forces.py new file mode 100644 index 00000000..59800b1f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/calculate_total_forces.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.total_tractive_torque_graph_input import TotalTractiveTorqueGraphInput +from ...models.total_tractive_torque_graph_output import TotalTractiveTorqueGraphOutput +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: TotalTractiveTorqueGraphInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}:calculate_forces".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | TotalTractiveTorqueGraphOutput | None: + if response.status_code == 200: + response_200 = TotalTractiveTorqueGraphOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | TotalTractiveTorqueGraphOutput] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Any | TotalTractiveTorqueGraphOutput | None: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | TotalTractiveTorqueGraphOutput + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | TotalTractiveTorqueGraphOutput] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Any | TotalTractiveTorqueGraphOutput | None: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | TotalTractiveTorqueGraphOutput + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/check_job_backend_availability.py b/schema/generated_client/conceptev_api_client/api/concept_v2/check_job_backend_availability.py new file mode 100644 index 00000000..a23e8021 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/check_job_backend_availability.py @@ -0,0 +1,202 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.check_job_backend_availability_response_check_job_backend_availability import ( + CheckJobBackendAvailabilityResponseCheckJobBackendAvailability, +) +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/availability".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + if response.status_code == 200: + response_200 = CheckJobBackendAvailabilityResponseCheckJobBackendAvailability.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = cast(Any, None) + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept.py new file mode 100644 index 00000000..8692803f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_input import ConceptInput +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + *, + body: ConceptInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ConceptOutput | HTTPValidationError | None: + if response.status_code == 201: + response_201 = ConceptOutput.from_dict(response.json()) + + return response_201 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[ConceptOutput | HTTPValidationError]: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> ConceptOutput | HTTPValidationError | None: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[ConceptOutput | HTTPValidationError]: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> ConceptOutput | HTTPValidationError | None: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept_part.py b/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept_part.py new file mode 100644 index 00000000..7650d007 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/create_concept_part.py @@ -0,0 +1,539 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_input import AeroInput +from ...models.aero_output import AeroOutput +from ...models.architecture_input import ArchitectureInput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_input import BatteryFixedVoltagesInput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_input import BatteryLookupTableInput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_input import DriveCycleInput +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_input import DriveCycleRequirementInput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_input import DynamicRequirementInput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.mass_input import MassInput +from ...models.mass_output import MassOutput +from ...models.motor_lab_input import MotorLabInput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_input import StaticRequirementInput +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_input import WheelInput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + *, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/{part_type}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + ), + } + + if isinstance(body, MotorLabInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryFixedVoltagesInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryLookupTableInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, TransmissionLossCoefficientsInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, AeroInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, MassInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, WheelInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, ArchitectureInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DriveCycleRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DynamicRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, StaticRequirementInput): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + if response.status_code == 201: + + def _parse_response_201( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_201_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_201_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_201_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_201_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_0 = AeroOutput.from_dict(data) + + return response_201_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_1 = MassOutput.from_dict(data) + + return response_201_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_2 = WheelOutput.from_dict(data) + + return response_201_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_2 = ArchitectureOutput.from_dict(data) + + return response_201_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_201_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_201_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_201_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_4 = DriveCycleOutput.from_dict(data) + + return response_201_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_201_type_5 = ConceptJobRecord.from_dict(data) + + return response_201_type_5 + + response_201 = _parse_response_201(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return sync_detailed( + id=id, + part_type=part_type, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/create_file_item.py b/schema/generated_client/conceptev_api_client/api/concept_v2/create_file_item.py new file mode 100644 index 00000000..82abe070 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/create_file_item.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_create_file_item import BodyCreateFileItem +from ...models.component_file_type import ComponentFileType +from ...models.file_item_create_response import FileItemCreateResponse +from ...types import UNSET, Response + + +def _get_kwargs( + id: str, + *, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["name"] = name + + json_component_file_type: str = component_file_type + params["component_file_type"] = json_component_file_type + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/files".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemCreateResponse | None: + if response.status_code == 201: + response_201 = FileItemCreateResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemCreateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Response[Any | FileItemCreateResponse]: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemCreateResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + name=name, + component_file_type=component_file_type, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Any | FileItemCreateResponse | None: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemCreateResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + name=name, + component_file_type=component_file_type, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Response[Any | FileItemCreateResponse]: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemCreateResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + name=name, + component_file_type=component_file_type, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Any | FileItemCreateResponse | None: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemCreateResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + name=name, + component_file_type=component_file_type, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/create_job.py b/schema/generated_client/conceptev_api_client/api/concept_v2/create_job.py new file mode 100644 index 00000000..5cd60f74 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/create_job.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_job_record import ConceptJobRecord +from ...models.job_request import JobRequest +from ...types import Response + + +def _get_kwargs( + concept_id: str, + *, + body: JobRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{concept_id}/job".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptJobRecord | None: + if response.status_code == 200: + response_200 = ConceptJobRecord.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptJobRecord]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Response[Any | ConceptJobRecord]: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptJobRecord] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Any | ConceptJobRecord | None: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptJobRecord + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Response[Any | ConceptJobRecord]: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptJobRecord] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Any | ConceptJobRecord | None: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptJobRecord + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept.py new file mode 100644 index 00000000..64cd6350 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept.py @@ -0,0 +1,171 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept_part.py b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept_part.py new file mode 100644 index 00000000..37242366 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_concept_part.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.part_type import PartType +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/delete_file_item.py b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_file_item.py new file mode 100644 index 00000000..6c6aa9ea --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_file_item.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/delete_job.py b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_job.py new file mode 100644 index 00000000..89babed0 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/delete_job.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{concept_id}/job/{job_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_component_display_data.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_component_display_data.py new file mode 100644 index 00000000..886faea7 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_component_display_data.py @@ -0,0 +1,310 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_loss_map_args import ComponentLossMapArgs +from ...models.loss_map_grid_lab import LossMapGridLab +from ...models.loss_map_grid_power import LossMapGridPower +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + part_id: str, + *, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/component/{part_id}:get_display_data".format( + id=quote(str(id), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + if isinstance(body, ComponentLossMapArgs): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + if response.status_code == 200: + + def _parse_response_200(data: object) -> Any | LossMapGridLab | LossMapGridPower: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0 = LossMapGridLab.from_dict(data) + + return response_200_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1 = LossMapGridPower.from_dict(data) + + return response_200_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Any | LossMapGridLab | LossMapGridPower, data) + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Any | LossMapGridLab | LossMapGridPower] + """ + + kwargs = _get_kwargs( + id=id, + part_id=part_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Any | LossMapGridLab | LossMapGridPower + """ + + return sync_detailed( + id=id, + part_id=part_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Any | LossMapGridLab | LossMapGridPower] + """ + + kwargs = _get_kwargs( + id=id, + part_id=part_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Any | LossMapGridLab | LossMapGridPower + """ + + return ( + await asyncio_detailed( + id=id, + part_id=part_id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept.py new file mode 100644 index 00000000..9b1dbdfd --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept_part.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept_part.py new file mode 100644 index 00000000..4d53868c --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_concept_part.py @@ -0,0 +1,433 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_output import AeroOutput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.http_validation_error import HTTPValidationError +from ...models.mass_output import MassOutput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + if response.status_code == 200: + + def _parse_response_200( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_200_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_200_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_200_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_200_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_0 = AeroOutput.from_dict(data) + + return response_200_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_1 = MassOutput.from_dict(data) + + return response_200_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_2 = WheelOutput.from_dict(data) + + return response_200_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_2 = ArchitectureOutput.from_dict(data) + + return response_200_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_200_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_200_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_200_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_4 = DriveCycleOutput.from_dict(data) + + return response_200_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_5 = ConceptJobRecord.from_dict(data) + + return response_200_type_5 + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_file_item.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_file_item.py new file mode 100644 index 00000000..c883558a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_file_item.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_item_output import FileItemOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = FileItemOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_job.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_job.py new file mode 100644 index 00000000..47a1cb85 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_job.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.job_output import JobOutput +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/{job_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | JobOutput | None: + if response.status_code == 200: + response_200 = JobOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | JobOutput]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | JobOutput]: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | JobOutput] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | JobOutput | None: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | JobOutput + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | JobOutput]: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | JobOutput] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | JobOutput | None: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | JobOutput + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/get_job_file.py b/schema/generated_client/conceptev_api_client/api/concept_v2/get_job_file.py new file mode 100644 index 00000000..4e54ad38 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/get_job_file.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/{job_id}/files/{file_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 307: + response_307 = cast(Any, None) + return response_307 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 409: + response_409 = cast(Any, None) + return response_409 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/list_jobs.py b/schema/generated_client/conceptev_api_client/api/concept_v2/list_jobs.py new file mode 100644 index 00000000..743fb53e --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/list_jobs.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.job_output import JobOutput +from ...types import Response + + +def _get_kwargs( + concept_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | list[JobOutput] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = JobOutput.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | list[JobOutput]] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | list[JobOutput] | None: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | list[JobOutput] + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | list[JobOutput]] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | list[JobOutput] | None: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | list[JobOutput] + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/open_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/open_concept.py new file mode 100644 index 00000000..cd184903 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/open_concept.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response + + +def _get_kwargs( + *, + path_to_file: str, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["path_to_file"] = path_to_file + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept:open", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + path_to_file=path_to_file, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + client=client, + path_to_file=path_to_file, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + path_to_file=path_to_file, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + path_to_file=path_to_file, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/save_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/save_concept.py new file mode 100644 index 00000000..3df3421e --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/save_concept.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.concept_save_request import ConceptSaveRequest +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: ConceptSaveRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/save".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept.py b/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept.py new file mode 100644 index 00000000..042d49db --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_input import ConceptInput +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: ConceptInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept_part.py b/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept_part.py new file mode 100644 index 00000000..17b89785 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/update_concept_part.py @@ -0,0 +1,553 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_input import AeroInput +from ...models.aero_output import AeroOutput +from ...models.architecture_input import ArchitectureInput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_input import BatteryFixedVoltagesInput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_input import BatteryLookupTableInput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_input import DriveCycleInput +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_input import DriveCycleRequirementInput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_input import DynamicRequirementInput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.mass_input import MassInput +from ...models.mass_output import MassOutput +from ...models.motor_lab_input import MotorLabInput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_input import StaticRequirementInput +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_input import WheelInput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, + *, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + if isinstance(body, MotorLabInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryFixedVoltagesInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryLookupTableInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, TransmissionLossCoefficientsInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, AeroInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, MassInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, WheelInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, ArchitectureInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DriveCycleRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DynamicRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, StaticRequirementInput): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + if response.status_code == 200: + + def _parse_response_200( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_200_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_200_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_200_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_200_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_0 = AeroOutput.from_dict(data) + + return response_200_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_1 = MassOutput.from_dict(data) + + return response_200_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_2 = WheelOutput.from_dict(data) + + return response_200_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_2 = ArchitectureOutput.from_dict(data) + + return response_200_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_200_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_200_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_200_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_4 = DriveCycleOutput.from_dict(data) + + return response_200_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_5 = ConceptJobRecord.from_dict(data) + + return response_200_type_5 + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/concept_v2/update_file_item.py b/schema/generated_client/conceptev_api_client/api/concept_v2/update_file_item.py new file mode 100644 index 00000000..2d8967fb --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/concept_v2/update_file_item.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_item_input import FileItemInput +from ...models.file_item_output import FileItemOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, + *, + body: FileItemInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = FileItemOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/__init__.py b/schema/generated_client/conceptev_api_client/api/unit_choices/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/create_unit_choices_unit_choices_post.py b/schema/generated_client/conceptev_api_client/api/unit_choices/create_unit_choices_unit_choices_post.py new file mode 100644 index 00000000..f6b02b61 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/create_unit_choices_unit_choices_post.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs( + *, + body: UnitChoices, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/unit_choices", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | UnitChoices | None: + if response.status_code == 201: + response_201 = UnitChoices.from_dict(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/delete_unit_choices_delete.py b/schema/generated_client/conceptev_api_client/api/unit_choices/delete_unit_choices_delete.py new file mode 100644 index 00000000..7ab4449b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/delete_unit_choices_delete.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/unit_choices", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | None: + if response.status_code == 200: + return None + + if response.status_code == 404: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete + + Delete by ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete + + Delete by ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/get_info_unit_choices_info_get.py b/schema/generated_client/conceptev_api_client/api/unit_choices/get_info_unit_choices_info_get.py new file mode 100644 index 00000000..ddb5e5ac --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/get_info_unit_choices_info_get.py @@ -0,0 +1,144 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_info_unit_choices_info_get_response_get_info_unit_choices_info_get import ( + GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet, +) +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/unit_choices/info", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + if response.status_code == 200: + response_200 = GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/read_unit_choices_get.py b/schema/generated_client/conceptev_api_client/api/unit_choices/read_unit_choices_get.py new file mode 100644 index 00000000..4a020ec8 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/read_unit_choices_get.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/unit_choices", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | UnitChoices | None: + if response.status_code == 200: + response_200 = UnitChoices.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | UnitChoices]: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | UnitChoices] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> Any | UnitChoices | None: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | UnitChoices + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | UnitChoices]: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | UnitChoices] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> Any | UnitChoices | None: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/api/unit_choices/update_unit_choices_put.py b/schema/generated_client/conceptev_api_client/api/unit_choices/update_unit_choices_put.py new file mode 100644 index 00000000..b1cdf4d6 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/api/unit_choices/update_unit_choices_put.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs( + *, + body: UnitChoices, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/unit_choices", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | UnitChoices | None: + if response.status_code == 200: + response_200 = UnitChoices.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/schema/generated_client/conceptev_api_client/client.py b/schema/generated_client/conceptev_api_client/client.py new file mode 100644 index 00000000..802f9a58 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/client.py @@ -0,0 +1,264 @@ +import ssl +from typing import Any + +from attrs import define, evolve, field +import httpx + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + """The token to use for authentication""" + prefix: str = "Bearer" + """The prefix to use for the Authorization header""" + auth_header_name: str = "Authorization" + """The name of the Authorization header""" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/schema/generated_client/conceptev_api_client/errors.py b/schema/generated_client/conceptev_api_client/errors.py new file mode 100644 index 00000000..5f92e76a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/schema/generated_client/conceptev_api_client/models/__init__.py b/schema/generated_client/conceptev_api_client/models/__init__.py new file mode 100644 index 00000000..81d0a41b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/__init__.py @@ -0,0 +1,223 @@ +"""Contains all the data models used in inputs/outputs""" + +from .acceleration_unit import AccelerationUnit +from .aero import Aero +from .aero_input import AeroInput +from .aero_output import AeroOutput +from .angle_unit import AngleUnit +from .angular_acceleration_unit import AngularAccelerationUnit +from .angular_speed_unit import AngularSpeedUnit +from .architecture_input import ArchitectureInput +from .architecture_output import ArchitectureOutput +from .area_unit import AreaUnit +from .battery_configuration import BatteryConfiguration +from .battery_fixed_voltages_input import BatteryFixedVoltagesInput +from .battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from .battery_lookup_table_data import BatteryLookupTableData +from .battery_lookup_table_input import BatteryLookupTableInput +from .battery_lookup_table_output import BatteryLookupTableOutput +from .battery_state import BatteryState +from .body_create_file_item import BodyCreateFileItem +from .check_job_backend_availability_response_check_job_backend_availability import ( + CheckJobBackendAvailabilityResponseCheckJobBackendAvailability, +) +from .component_axle import ComponentAxle +from .component_configuration_set import ComponentConfigurationSet +from .component_file_type import ComponentFileType +from .component_loss_map_args import ComponentLossMapArgs +from .concept_input import ConceptInput +from .concept_job_record import ConceptJobRecord +from .concept_output import ConceptOutput +from .concept_save_request import ConceptSaveRequest +from .current_unit import CurrentUnit +from .density_unit import DensityUnit +from .drive_cycle_input import DriveCycleInput +from .drive_cycle_output import DriveCycleOutput +from .drive_cycle_requirement_input import DriveCycleRequirementInput +from .drive_cycle_requirement_output import DriveCycleRequirementOutput +from .dynamic_requirement_input import DynamicRequirementInput +from .dynamic_requirement_output import DynamicRequirementOutput +from .edge import Edge +from .electric_charge_unit import ElectricChargeUnit +from .electrical_energy_unit import ElectricalEnergyUnit +from .electrical_power_unit import ElectricalPowerUnit +from .energy_unit import EnergyUnit +from .file_info import FileInfo +from .file_item_create_response import FileItemCreateResponse +from .file_item_create_response_calculated_values import FileItemCreateResponseCalculatedValues +from .file_item_input import FileItemInput +from .file_item_output import FileItemOutput +from .force_unit import ForceUnit +from .frequency_unit import FrequencyUnit +from .get_info_unit_choices_info_get_response_get_info_unit_choices_info_get import ( + GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet, +) +from .http_validation_error import HTTPValidationError +from .inertia_unit import InertiaUnit +from .job_output import JobOutput +from .job_request import JobRequest +from .length_unit import LengthUnit +from .loss_map_grid_lab import LossMapGridLab +from .loss_map_grid_power import LossMapGridPower +from .loss_map_grid_power_meta_data import LossMapGridPowerMetaData +from .mass import Mass +from .mass_input import MassInput +from .mass_output import MassOutput +from .mass_unit import MassUnit +from .motor_configuration import MotorConfiguration +from .motor_lab_data import MotorLabData +from .motor_lab_data_lab_file_dict import MotorLabDataLabFileDict +from .motor_lab_input import MotorLabInput +from .motor_lab_output import MotorLabOutput +from .motor_state import MotorState +from .motor_thermal_limits import MotorThermalLimits +from .node import Node +from .part_type import PartType +from .power_unit import PowerUnit +from .pressure_unit import PressureUnit +from .ratio_unit import RatioUnit +from .resistance_unit import ResistanceUnit +from .road_efficiency_unit import RoadEfficiencyUnit +from .save_state import SaveState +from .speed_unit import SpeedUnit +from .static_requirement_input import StaticRequirementInput +from .static_requirement_output import StaticRequirementOutput +from .surface_condition_traction_configs import SurfaceConditionTractionConfigs +from .temperature_unit import TemperatureUnit +from .thermal_model import ThermalModel +from .thermal_model_loss_map import ThermalModelLossMap +from .thermal_model_loss_map_additional_property import ThermalModelLossMapAdditionalProperty +from .thermal_model_temperature_map import ThermalModelTemperatureMap +from .thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, +) +from .thermal_network import ThermalNetwork +from .thermal_network_edges import ThermalNetworkEdges +from .thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict +from .thermal_network_nodes import ThermalNetworkNodes +from .thermal_network_speed_dict import ThermalNetworkSpeedDict +from .time_unit import TimeUnit +from .torque_unit import TorqueUnit +from .total_tractive_torque_graph_input import TotalTractiveTorqueGraphInput +from .total_tractive_torque_graph_output import TotalTractiveTorqueGraphOutput +from .transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from .transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from .unit_choices import UnitChoices +from .unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap +from .validation_error import ValidationError +from .validation_error_context import ValidationErrorContext +from .voltage_unit import VoltageUnit +from .volume_unit import VolumeUnit +from .volumetric_flow_rate_unit import VolumetricFlowRateUnit +from .wheel_input import WheelInput +from .wheel_output import WheelOutput +from .wheel_rolling_resistance_configs import WheelRollingResistanceConfigs + +__all__ = ( + "AccelerationUnit", + "Aero", + "AeroInput", + "AeroOutput", + "AngleUnit", + "AngularAccelerationUnit", + "AngularSpeedUnit", + "ArchitectureInput", + "ArchitectureOutput", + "AreaUnit", + "BatteryConfiguration", + "BatteryFixedVoltagesInput", + "BatteryFixedVoltagesOutput", + "BatteryLookupTableData", + "BatteryLookupTableInput", + "BatteryLookupTableOutput", + "BatteryState", + "BodyCreateFileItem", + "CheckJobBackendAvailabilityResponseCheckJobBackendAvailability", + "ComponentAxle", + "ComponentConfigurationSet", + "ComponentFileType", + "ComponentLossMapArgs", + "ConceptInput", + "ConceptJobRecord", + "ConceptOutput", + "ConceptSaveRequest", + "CurrentUnit", + "DensityUnit", + "DriveCycleInput", + "DriveCycleOutput", + "DriveCycleRequirementInput", + "DriveCycleRequirementOutput", + "DynamicRequirementInput", + "DynamicRequirementOutput", + "Edge", + "ElectricalEnergyUnit", + "ElectricalPowerUnit", + "ElectricChargeUnit", + "EnergyUnit", + "FileInfo", + "FileItemCreateResponse", + "FileItemCreateResponseCalculatedValues", + "FileItemInput", + "FileItemOutput", + "ForceUnit", + "FrequencyUnit", + "GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet", + "HTTPValidationError", + "InertiaUnit", + "JobOutput", + "JobRequest", + "LengthUnit", + "LossMapGridLab", + "LossMapGridPower", + "LossMapGridPowerMetaData", + "Mass", + "MassInput", + "MassOutput", + "MassUnit", + "MotorConfiguration", + "MotorLabData", + "MotorLabDataLabFileDict", + "MotorLabInput", + "MotorLabOutput", + "MotorState", + "MotorThermalLimits", + "Node", + "PartType", + "PowerUnit", + "PressureUnit", + "RatioUnit", + "ResistanceUnit", + "RoadEfficiencyUnit", + "SaveState", + "SpeedUnit", + "StaticRequirementInput", + "StaticRequirementOutput", + "SurfaceConditionTractionConfigs", + "TemperatureUnit", + "ThermalModel", + "ThermalModelLossMap", + "ThermalModelLossMapAdditionalProperty", + "ThermalModelTemperatureMap", + "ThermalModelTemperatureMapAdditionalProperty", + "ThermalNetwork", + "ThermalNetworkEdges", + "ThermalNetworkFlowRateDict", + "ThermalNetworkNodes", + "ThermalNetworkSpeedDict", + "TimeUnit", + "TorqueUnit", + "TotalTractiveTorqueGraphInput", + "TotalTractiveTorqueGraphOutput", + "TransmissionLossCoefficientsInput", + "TransmissionLossCoefficientsOutput", + "UnitChoices", + "UnitChoicesUnitTypeToUnitMap", + "ValidationError", + "ValidationErrorContext", + "VoltageUnit", + "VolumetricFlowRateUnit", + "VolumeUnit", + "WheelInput", + "WheelOutput", + "WheelRollingResistanceConfigs", +) diff --git a/schema/generated_client/conceptev_api_client/models/acceleration_unit.py b/schema/generated_client/conceptev_api_client/models/acceleration_unit.py new file mode 100644 index 00000000..18eea3de --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/acceleration_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +AccelerationUnit = Literal["km/hr/s", "m/s²", "mph/s"] + +ACCELERATION_UNIT_VALUES: set[AccelerationUnit] = { + "km/hr/s", + "m/s²", + "mph/s", +} + + +def check_acceleration_unit(value: str) -> AccelerationUnit: + if value in ACCELERATION_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ACCELERATION_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/aero.py b/schema/generated_client/conceptev_api_client/models/aero.py new file mode 100644 index 00000000..b6a92629 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/aero.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Aero") + + +@_attrs_define +class Aero: + """Aero Configuration.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + aero = cls( + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + ) + + aero.additional_properties = d + return aero + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/aero_input.py b/schema/generated_client/conceptev_api_client/models/aero_input.py new file mode 100644 index 00000000..a8a2428a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/aero_input.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AeroInput") + + +@_attrs_define +class AeroInput: + """Aero Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + aero_input = cls( + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + part_type=part_type, + ) + + aero_input.additional_properties = d + return aero_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/aero_output.py b/schema/generated_client/conceptev_api_client/models/aero_output.py new file mode 100644 index 00000000..92219408 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/aero_output.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AeroOutput") + + +@_attrs_define +class AeroOutput: + """Aero Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + aero_output = cls( + id=id, + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + part_type=part_type, + ) + + aero_output.additional_properties = d + return aero_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/angle_unit.py b/schema/generated_client/conceptev_api_client/models/angle_unit.py new file mode 100644 index 00000000..7a0eab57 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/angle_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +AngleUnit = Literal["%", "deg", "rad"] + +ANGLE_UNIT_VALUES: set[AngleUnit] = { + "%", + "deg", + "rad", +} + + +def check_angle_unit(value: str) -> AngleUnit: + if value in ANGLE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ANGLE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/angular_acceleration_unit.py b/schema/generated_client/conceptev_api_client/models/angular_acceleration_unit.py new file mode 100644 index 00000000..08332033 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/angular_acceleration_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +AngularAccelerationUnit = Literal["deg/s²", "rad/s²", "rpm/s", "rps/s"] + +ANGULAR_ACCELERATION_UNIT_VALUES: set[AngularAccelerationUnit] = { + "deg/s²", + "rad/s²", + "rpm/s", + "rps/s", +} + + +def check_angular_acceleration_unit(value: str) -> AngularAccelerationUnit: + if value in ANGULAR_ACCELERATION_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ANGULAR_ACCELERATION_UNIT_VALUES!r}" + ) diff --git a/schema/generated_client/conceptev_api_client/models/angular_speed_unit.py b/schema/generated_client/conceptev_api_client/models/angular_speed_unit.py new file mode 100644 index 00000000..cbd1197a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/angular_speed_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +AngularSpeedUnit = Literal["deg/s", "rad/s", "rpm", "rps"] + +ANGULAR_SPEED_UNIT_VALUES: set[AngularSpeedUnit] = { + "deg/s", + "rad/s", + "rpm", + "rps", +} + + +def check_angular_speed_unit(value: str) -> AngularSpeedUnit: + if value in ANGULAR_SPEED_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ANGULAR_SPEED_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/architecture_input.py b/schema/generated_client/conceptev_api_client/models/architecture_input.py new file mode 100644 index 00000000..999a6450 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/architecture_input.py @@ -0,0 +1,345 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ArchitectureInput") + + +@_attrs_define +class ArchitectureInput: + """Architecture Input.""" + + battery_id: str + wheelbase: float | None | Unset = UNSET + number_of_front_motors: int | Unset = 0 + number_of_front_wheels: int | Unset = 2 + number_of_rear_motors: int | Unset = 0 + number_of_rear_wheels: int | Unset = 2 + battery: None | Unset = UNSET + front_transmission: None | Unset = UNSET + front_motor: None | Unset = UNSET + front_inverter: None | Unset = UNSET + front_clutch: None | Unset = UNSET + rear_transmission: None | Unset = UNSET + rear_motor: None | Unset = UNSET + rear_inverter: None | Unset = UNSET + rear_clutch: None | Unset = UNSET + front_transmission_id: None | str | Unset = UNSET + front_motor_id: None | str | Unset = UNSET + front_inverter_id: None | str | Unset = UNSET + front_clutch_id: None | str | Unset = UNSET + rear_transmission_id: None | str | Unset = UNSET + rear_motor_id: None | str | Unset = UNSET + rear_inverter_id: None | str | Unset = UNSET + rear_clutch_id: None | str | Unset = UNSET + part_type: Literal["architecture"] | Unset = "architecture" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + battery_id = self.battery_id + + wheelbase: float | None | Unset + if isinstance(self.wheelbase, Unset): + wheelbase = UNSET + else: + wheelbase = self.wheelbase + + number_of_front_motors = self.number_of_front_motors + + number_of_front_wheels = self.number_of_front_wheels + + number_of_rear_motors = self.number_of_rear_motors + + number_of_rear_wheels = self.number_of_rear_wheels + + battery = self.battery + + front_transmission = self.front_transmission + + front_motor = self.front_motor + + front_inverter = self.front_inverter + + front_clutch = self.front_clutch + + rear_transmission = self.rear_transmission + + rear_motor = self.rear_motor + + rear_inverter = self.rear_inverter + + rear_clutch = self.rear_clutch + + front_transmission_id: None | str | Unset + if isinstance(self.front_transmission_id, Unset): + front_transmission_id = UNSET + else: + front_transmission_id = self.front_transmission_id + + front_motor_id: None | str | Unset + if isinstance(self.front_motor_id, Unset): + front_motor_id = UNSET + else: + front_motor_id = self.front_motor_id + + front_inverter_id: None | str | Unset + if isinstance(self.front_inverter_id, Unset): + front_inverter_id = UNSET + else: + front_inverter_id = self.front_inverter_id + + front_clutch_id: None | str | Unset + if isinstance(self.front_clutch_id, Unset): + front_clutch_id = UNSET + else: + front_clutch_id = self.front_clutch_id + + rear_transmission_id: None | str | Unset + if isinstance(self.rear_transmission_id, Unset): + rear_transmission_id = UNSET + else: + rear_transmission_id = self.rear_transmission_id + + rear_motor_id: None | str | Unset + if isinstance(self.rear_motor_id, Unset): + rear_motor_id = UNSET + else: + rear_motor_id = self.rear_motor_id + + rear_inverter_id: None | str | Unset + if isinstance(self.rear_inverter_id, Unset): + rear_inverter_id = UNSET + else: + rear_inverter_id = self.rear_inverter_id + + rear_clutch_id: None | str | Unset + if isinstance(self.rear_clutch_id, Unset): + rear_clutch_id = UNSET + else: + rear_clutch_id = self.rear_clutch_id + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "battery_id": battery_id, + } + ) + if wheelbase is not UNSET: + field_dict["wheelbase"] = wheelbase + if number_of_front_motors is not UNSET: + field_dict["number_of_front_motors"] = number_of_front_motors + if number_of_front_wheels is not UNSET: + field_dict["number_of_front_wheels"] = number_of_front_wheels + if number_of_rear_motors is not UNSET: + field_dict["number_of_rear_motors"] = number_of_rear_motors + if number_of_rear_wheels is not UNSET: + field_dict["number_of_rear_wheels"] = number_of_rear_wheels + if battery is not UNSET: + field_dict["battery"] = battery + if front_transmission is not UNSET: + field_dict["front_transmission"] = front_transmission + if front_motor is not UNSET: + field_dict["front_motor"] = front_motor + if front_inverter is not UNSET: + field_dict["front_inverter"] = front_inverter + if front_clutch is not UNSET: + field_dict["front_clutch"] = front_clutch + if rear_transmission is not UNSET: + field_dict["rear_transmission"] = rear_transmission + if rear_motor is not UNSET: + field_dict["rear_motor"] = rear_motor + if rear_inverter is not UNSET: + field_dict["rear_inverter"] = rear_inverter + if rear_clutch is not UNSET: + field_dict["rear_clutch"] = rear_clutch + if front_transmission_id is not UNSET: + field_dict["front_transmission_id"] = front_transmission_id + if front_motor_id is not UNSET: + field_dict["front_motor_id"] = front_motor_id + if front_inverter_id is not UNSET: + field_dict["front_inverter_id"] = front_inverter_id + if front_clutch_id is not UNSET: + field_dict["front_clutch_id"] = front_clutch_id + if rear_transmission_id is not UNSET: + field_dict["rear_transmission_id"] = rear_transmission_id + if rear_motor_id is not UNSET: + field_dict["rear_motor_id"] = rear_motor_id + if rear_inverter_id is not UNSET: + field_dict["rear_inverter_id"] = rear_inverter_id + if rear_clutch_id is not UNSET: + field_dict["rear_clutch_id"] = rear_clutch_id + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + battery_id = d.pop("battery_id") + + def _parse_wheelbase(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + wheelbase = _parse_wheelbase(d.pop("wheelbase", UNSET)) + + number_of_front_motors = d.pop("number_of_front_motors", UNSET) + + number_of_front_wheels = d.pop("number_of_front_wheels", UNSET) + + number_of_rear_motors = d.pop("number_of_rear_motors", UNSET) + + number_of_rear_wheels = d.pop("number_of_rear_wheels", UNSET) + + battery = d.pop("battery", UNSET) + + front_transmission = d.pop("front_transmission", UNSET) + + front_motor = d.pop("front_motor", UNSET) + + front_inverter = d.pop("front_inverter", UNSET) + + front_clutch = d.pop("front_clutch", UNSET) + + rear_transmission = d.pop("rear_transmission", UNSET) + + rear_motor = d.pop("rear_motor", UNSET) + + rear_inverter = d.pop("rear_inverter", UNSET) + + rear_clutch = d.pop("rear_clutch", UNSET) + + def _parse_front_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_transmission_id = _parse_front_transmission_id(d.pop("front_transmission_id", UNSET)) + + def _parse_front_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_motor_id = _parse_front_motor_id(d.pop("front_motor_id", UNSET)) + + def _parse_front_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_inverter_id = _parse_front_inverter_id(d.pop("front_inverter_id", UNSET)) + + def _parse_front_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_clutch_id = _parse_front_clutch_id(d.pop("front_clutch_id", UNSET)) + + def _parse_rear_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_transmission_id = _parse_rear_transmission_id(d.pop("rear_transmission_id", UNSET)) + + def _parse_rear_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_motor_id = _parse_rear_motor_id(d.pop("rear_motor_id", UNSET)) + + def _parse_rear_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_inverter_id = _parse_rear_inverter_id(d.pop("rear_inverter_id", UNSET)) + + def _parse_rear_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_clutch_id = _parse_rear_clutch_id(d.pop("rear_clutch_id", UNSET)) + + part_type = cast(Literal["architecture"] | Unset, d.pop("part_type", UNSET)) + if part_type != "architecture" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'architecture', got '{part_type}'") + + architecture_input = cls( + battery_id=battery_id, + wheelbase=wheelbase, + number_of_front_motors=number_of_front_motors, + number_of_front_wheels=number_of_front_wheels, + number_of_rear_motors=number_of_rear_motors, + number_of_rear_wheels=number_of_rear_wheels, + battery=battery, + front_transmission=front_transmission, + front_motor=front_motor, + front_inverter=front_inverter, + front_clutch=front_clutch, + rear_transmission=rear_transmission, + rear_motor=rear_motor, + rear_inverter=rear_inverter, + rear_clutch=rear_clutch, + front_transmission_id=front_transmission_id, + front_motor_id=front_motor_id, + front_inverter_id=front_inverter_id, + front_clutch_id=front_clutch_id, + rear_transmission_id=rear_transmission_id, + rear_motor_id=rear_motor_id, + rear_inverter_id=rear_inverter_id, + rear_clutch_id=rear_clutch_id, + part_type=part_type, + ) + + architecture_input.additional_properties = d + return architecture_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/architecture_output.py b/schema/generated_client/conceptev_api_client/models/architecture_output.py new file mode 100644 index 00000000..37ca1897 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/architecture_output.py @@ -0,0 +1,376 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ArchitectureOutput") + + +@_attrs_define +class ArchitectureOutput: + """Architecture Output.""" + + id: str + battery_id: str + wheelbase: float | None | Unset = UNSET + number_of_front_motors: int | Unset = 0 + number_of_front_wheels: int | Unset = 2 + number_of_rear_motors: int | Unset = 0 + number_of_rear_wheels: int | Unset = 2 + battery: None | Unset = UNSET + front_transmission: None | Unset = UNSET + front_motor: None | Unset = UNSET + front_inverter: None | Unset = UNSET + front_clutch: None | Unset = UNSET + rear_transmission: None | Unset = UNSET + rear_motor: None | Unset = UNSET + rear_inverter: None | Unset = UNSET + rear_clutch: None | Unset = UNSET + front_transmission_id: None | str | Unset = UNSET + front_motor_id: None | str | Unset = UNSET + front_inverter_id: None | str | Unset = UNSET + front_clutch_id: None | str | Unset = UNSET + rear_transmission_id: None | str | Unset = UNSET + rear_motor_id: None | str | Unset = UNSET + rear_inverter_id: None | str | Unset = UNSET + rear_clutch_id: None | str | Unset = UNSET + part_type: Literal["architecture"] | Unset = "architecture" + components_cost: float | Unset = 0.0 + components_mass: float | Unset = 0.0 + max_wheel_speed: float | Unset = 0.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + battery_id = self.battery_id + + wheelbase: float | None | Unset + if isinstance(self.wheelbase, Unset): + wheelbase = UNSET + else: + wheelbase = self.wheelbase + + number_of_front_motors = self.number_of_front_motors + + number_of_front_wheels = self.number_of_front_wheels + + number_of_rear_motors = self.number_of_rear_motors + + number_of_rear_wheels = self.number_of_rear_wheels + + battery = self.battery + + front_transmission = self.front_transmission + + front_motor = self.front_motor + + front_inverter = self.front_inverter + + front_clutch = self.front_clutch + + rear_transmission = self.rear_transmission + + rear_motor = self.rear_motor + + rear_inverter = self.rear_inverter + + rear_clutch = self.rear_clutch + + front_transmission_id: None | str | Unset + if isinstance(self.front_transmission_id, Unset): + front_transmission_id = UNSET + else: + front_transmission_id = self.front_transmission_id + + front_motor_id: None | str | Unset + if isinstance(self.front_motor_id, Unset): + front_motor_id = UNSET + else: + front_motor_id = self.front_motor_id + + front_inverter_id: None | str | Unset + if isinstance(self.front_inverter_id, Unset): + front_inverter_id = UNSET + else: + front_inverter_id = self.front_inverter_id + + front_clutch_id: None | str | Unset + if isinstance(self.front_clutch_id, Unset): + front_clutch_id = UNSET + else: + front_clutch_id = self.front_clutch_id + + rear_transmission_id: None | str | Unset + if isinstance(self.rear_transmission_id, Unset): + rear_transmission_id = UNSET + else: + rear_transmission_id = self.rear_transmission_id + + rear_motor_id: None | str | Unset + if isinstance(self.rear_motor_id, Unset): + rear_motor_id = UNSET + else: + rear_motor_id = self.rear_motor_id + + rear_inverter_id: None | str | Unset + if isinstance(self.rear_inverter_id, Unset): + rear_inverter_id = UNSET + else: + rear_inverter_id = self.rear_inverter_id + + rear_clutch_id: None | str | Unset + if isinstance(self.rear_clutch_id, Unset): + rear_clutch_id = UNSET + else: + rear_clutch_id = self.rear_clutch_id + + part_type = self.part_type + + components_cost = self.components_cost + + components_mass = self.components_mass + + max_wheel_speed = self.max_wheel_speed + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "battery_id": battery_id, + } + ) + if wheelbase is not UNSET: + field_dict["wheelbase"] = wheelbase + if number_of_front_motors is not UNSET: + field_dict["number_of_front_motors"] = number_of_front_motors + if number_of_front_wheels is not UNSET: + field_dict["number_of_front_wheels"] = number_of_front_wheels + if number_of_rear_motors is not UNSET: + field_dict["number_of_rear_motors"] = number_of_rear_motors + if number_of_rear_wheels is not UNSET: + field_dict["number_of_rear_wheels"] = number_of_rear_wheels + if battery is not UNSET: + field_dict["battery"] = battery + if front_transmission is not UNSET: + field_dict["front_transmission"] = front_transmission + if front_motor is not UNSET: + field_dict["front_motor"] = front_motor + if front_inverter is not UNSET: + field_dict["front_inverter"] = front_inverter + if front_clutch is not UNSET: + field_dict["front_clutch"] = front_clutch + if rear_transmission is not UNSET: + field_dict["rear_transmission"] = rear_transmission + if rear_motor is not UNSET: + field_dict["rear_motor"] = rear_motor + if rear_inverter is not UNSET: + field_dict["rear_inverter"] = rear_inverter + if rear_clutch is not UNSET: + field_dict["rear_clutch"] = rear_clutch + if front_transmission_id is not UNSET: + field_dict["front_transmission_id"] = front_transmission_id + if front_motor_id is not UNSET: + field_dict["front_motor_id"] = front_motor_id + if front_inverter_id is not UNSET: + field_dict["front_inverter_id"] = front_inverter_id + if front_clutch_id is not UNSET: + field_dict["front_clutch_id"] = front_clutch_id + if rear_transmission_id is not UNSET: + field_dict["rear_transmission_id"] = rear_transmission_id + if rear_motor_id is not UNSET: + field_dict["rear_motor_id"] = rear_motor_id + if rear_inverter_id is not UNSET: + field_dict["rear_inverter_id"] = rear_inverter_id + if rear_clutch_id is not UNSET: + field_dict["rear_clutch_id"] = rear_clutch_id + if part_type is not UNSET: + field_dict["part_type"] = part_type + if components_cost is not UNSET: + field_dict["components_cost"] = components_cost + if components_mass is not UNSET: + field_dict["components_mass"] = components_mass + if max_wheel_speed is not UNSET: + field_dict["max_wheel_speed"] = max_wheel_speed + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + battery_id = d.pop("battery_id") + + def _parse_wheelbase(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + wheelbase = _parse_wheelbase(d.pop("wheelbase", UNSET)) + + number_of_front_motors = d.pop("number_of_front_motors", UNSET) + + number_of_front_wheels = d.pop("number_of_front_wheels", UNSET) + + number_of_rear_motors = d.pop("number_of_rear_motors", UNSET) + + number_of_rear_wheels = d.pop("number_of_rear_wheels", UNSET) + + battery = d.pop("battery", UNSET) + + front_transmission = d.pop("front_transmission", UNSET) + + front_motor = d.pop("front_motor", UNSET) + + front_inverter = d.pop("front_inverter", UNSET) + + front_clutch = d.pop("front_clutch", UNSET) + + rear_transmission = d.pop("rear_transmission", UNSET) + + rear_motor = d.pop("rear_motor", UNSET) + + rear_inverter = d.pop("rear_inverter", UNSET) + + rear_clutch = d.pop("rear_clutch", UNSET) + + def _parse_front_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_transmission_id = _parse_front_transmission_id(d.pop("front_transmission_id", UNSET)) + + def _parse_front_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_motor_id = _parse_front_motor_id(d.pop("front_motor_id", UNSET)) + + def _parse_front_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_inverter_id = _parse_front_inverter_id(d.pop("front_inverter_id", UNSET)) + + def _parse_front_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_clutch_id = _parse_front_clutch_id(d.pop("front_clutch_id", UNSET)) + + def _parse_rear_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_transmission_id = _parse_rear_transmission_id(d.pop("rear_transmission_id", UNSET)) + + def _parse_rear_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_motor_id = _parse_rear_motor_id(d.pop("rear_motor_id", UNSET)) + + def _parse_rear_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_inverter_id = _parse_rear_inverter_id(d.pop("rear_inverter_id", UNSET)) + + def _parse_rear_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_clutch_id = _parse_rear_clutch_id(d.pop("rear_clutch_id", UNSET)) + + part_type = cast(Literal["architecture"] | Unset, d.pop("part_type", UNSET)) + if part_type != "architecture" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'architecture', got '{part_type}'") + + components_cost = d.pop("components_cost", UNSET) + + components_mass = d.pop("components_mass", UNSET) + + max_wheel_speed = d.pop("max_wheel_speed", UNSET) + + architecture_output = cls( + id=id, + battery_id=battery_id, + wheelbase=wheelbase, + number_of_front_motors=number_of_front_motors, + number_of_front_wheels=number_of_front_wheels, + number_of_rear_motors=number_of_rear_motors, + number_of_rear_wheels=number_of_rear_wheels, + battery=battery, + front_transmission=front_transmission, + front_motor=front_motor, + front_inverter=front_inverter, + front_clutch=front_clutch, + rear_transmission=rear_transmission, + rear_motor=rear_motor, + rear_inverter=rear_inverter, + rear_clutch=rear_clutch, + front_transmission_id=front_transmission_id, + front_motor_id=front_motor_id, + front_inverter_id=front_inverter_id, + front_clutch_id=front_clutch_id, + rear_transmission_id=rear_transmission_id, + rear_motor_id=rear_motor_id, + rear_inverter_id=rear_inverter_id, + rear_clutch_id=rear_clutch_id, + part_type=part_type, + components_cost=components_cost, + components_mass=components_mass, + max_wheel_speed=max_wheel_speed, + ) + + architecture_output.additional_properties = d + return architecture_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/area_unit.py b/schema/generated_client/conceptev_api_client/models/area_unit.py new file mode 100644 index 00000000..b326170e --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/area_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +AreaUnit = Literal["cm²", "ft²", "in²", "mm²", "m²", "yd²"] + +AREA_UNIT_VALUES: set[AreaUnit] = { + "cm²", + "ft²", + "in²", + "mm²", + "m²", + "yd²", +} + + +def check_area_unit(value: str) -> AreaUnit: + if value in AREA_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AREA_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/battery_configuration.py b/schema/generated_client/conceptev_api_client/models/battery_configuration.py new file mode 100644 index 00000000..ee94f869 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_configuration.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryConfiguration") + + +@_attrs_define +class BatteryConfiguration: + """Configuration that can change characteristics of the battery.""" + + component_config_type: Literal["battery"] | Unset = "battery" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_config_type = self.component_config_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if component_config_type is not UNSET: + field_dict["component_config_type"] = component_config_type + if state is not UNSET: + field_dict["state"] = state + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + component_config_type = cast( + Literal["battery"] | Unset, d.pop("component_config_type", UNSET) + ) + if component_config_type != "battery" and not isinstance(component_config_type, Unset): + raise ValueError( + f"component_config_type must match const 'battery', got '{component_config_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + battery_configuration = cls( + component_config_type=component_config_type, + state=state, + ) + + battery_configuration.additional_properties = d + return battery_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_input.py b/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_input.py new file mode 100644 index 00000000..65f5f964 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_input.py @@ -0,0 +1,240 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryFixedVoltagesInput") + + +@_attrs_define +class BatteryFixedVoltagesInput: + """Battery Fixed Voltages Input.""" + + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Fixed Voltages Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryFixedVoltages"] | Unset = "BatteryFixedVoltages" + voltage_max: float | Unset = 400.0 + voltage_min: float | None | Unset = UNSET + charge_acceptance_limit: float | None | Unset = UNSET + charge_release_limit: float | None | Unset = UNSET + capacity: float | None | Unset = UNSET + internal_resistance_charge: float | Unset = 0.0 + internal_resistance_discharge: float | Unset = 0.0 + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + voltage_max = self.voltage_max + + voltage_min: float | None | Unset + if isinstance(self.voltage_min, Unset): + voltage_min = UNSET + else: + voltage_min = self.voltage_min + + charge_acceptance_limit: float | None | Unset + if isinstance(self.charge_acceptance_limit, Unset): + charge_acceptance_limit = UNSET + else: + charge_acceptance_limit = self.charge_acceptance_limit + + charge_release_limit: float | None | Unset + if isinstance(self.charge_release_limit, Unset): + charge_release_limit = UNSET + else: + charge_release_limit = self.charge_release_limit + + capacity: float | None | Unset + if isinstance(self.capacity, Unset): + capacity = UNSET + else: + capacity = self.capacity + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if voltage_max is not UNSET: + field_dict["voltage_max"] = voltage_max + if voltage_min is not UNSET: + field_dict["voltage_min"] = voltage_min + if charge_acceptance_limit is not UNSET: + field_dict["charge_acceptance_limit"] = charge_acceptance_limit + if charge_release_limit is not UNSET: + field_dict["charge_release_limit"] = charge_release_limit + if capacity is not UNSET: + field_dict["capacity"] = capacity + if internal_resistance_charge is not UNSET: + field_dict["internal_resistance_charge"] = internal_resistance_charge + if internal_resistance_discharge is not UNSET: + field_dict["internal_resistance_discharge"] = internal_resistance_discharge + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["BatteryFixedVoltages"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "BatteryFixedVoltages" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryFixedVoltages', got '{component_type}'" + ) + + voltage_max = d.pop("voltage_max", UNSET) + + def _parse_voltage_min(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage_min = _parse_voltage_min(d.pop("voltage_min", UNSET)) + + def _parse_charge_acceptance_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_acceptance_limit = _parse_charge_acceptance_limit( + d.pop("charge_acceptance_limit", UNSET) + ) + + def _parse_charge_release_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_release_limit = _parse_charge_release_limit(d.pop("charge_release_limit", UNSET)) + + def _parse_capacity(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + capacity = _parse_capacity(d.pop("capacity", UNSET)) + + internal_resistance_charge = d.pop("internal_resistance_charge", UNSET) + + internal_resistance_discharge = d.pop("internal_resistance_discharge", UNSET) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_fixed_voltages_input = cls( + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + voltage_max=voltage_max, + voltage_min=voltage_min, + charge_acceptance_limit=charge_acceptance_limit, + charge_release_limit=charge_release_limit, + capacity=capacity, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + state=state, + part_type=part_type, + ) + + battery_fixed_voltages_input.additional_properties = d + return battery_fixed_voltages_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_output.py b/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_output.py new file mode 100644 index 00000000..32cd00d8 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_fixed_voltages_output.py @@ -0,0 +1,250 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryFixedVoltagesOutput") + + +@_attrs_define +class BatteryFixedVoltagesOutput: + """Battery Fixed Voltages Output.""" + + id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Fixed Voltages Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryFixedVoltages"] | Unset = "BatteryFixedVoltages" + voltage_max: float | Unset = 400.0 + voltage_min: float | None | Unset = UNSET + charge_acceptance_limit: float | None | Unset = UNSET + charge_release_limit: float | None | Unset = UNSET + capacity: float | None | Unset = UNSET + internal_resistance_charge: float | Unset = 0.0 + internal_resistance_discharge: float | Unset = 0.0 + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + voltage_max = self.voltage_max + + voltage_min: float | None | Unset + if isinstance(self.voltage_min, Unset): + voltage_min = UNSET + else: + voltage_min = self.voltage_min + + charge_acceptance_limit: float | None | Unset + if isinstance(self.charge_acceptance_limit, Unset): + charge_acceptance_limit = UNSET + else: + charge_acceptance_limit = self.charge_acceptance_limit + + charge_release_limit: float | None | Unset + if isinstance(self.charge_release_limit, Unset): + charge_release_limit = UNSET + else: + charge_release_limit = self.charge_release_limit + + capacity: float | None | Unset + if isinstance(self.capacity, Unset): + capacity = UNSET + else: + capacity = self.capacity + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if voltage_max is not UNSET: + field_dict["voltage_max"] = voltage_max + if voltage_min is not UNSET: + field_dict["voltage_min"] = voltage_min + if charge_acceptance_limit is not UNSET: + field_dict["charge_acceptance_limit"] = charge_acceptance_limit + if charge_release_limit is not UNSET: + field_dict["charge_release_limit"] = charge_release_limit + if capacity is not UNSET: + field_dict["capacity"] = capacity + if internal_resistance_charge is not UNSET: + field_dict["internal_resistance_charge"] = internal_resistance_charge + if internal_resistance_discharge is not UNSET: + field_dict["internal_resistance_discharge"] = internal_resistance_discharge + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["BatteryFixedVoltages"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "BatteryFixedVoltages" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryFixedVoltages', got '{component_type}'" + ) + + voltage_max = d.pop("voltage_max", UNSET) + + def _parse_voltage_min(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage_min = _parse_voltage_min(d.pop("voltage_min", UNSET)) + + def _parse_charge_acceptance_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_acceptance_limit = _parse_charge_acceptance_limit( + d.pop("charge_acceptance_limit", UNSET) + ) + + def _parse_charge_release_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_release_limit = _parse_charge_release_limit(d.pop("charge_release_limit", UNSET)) + + def _parse_capacity(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + capacity = _parse_capacity(d.pop("capacity", UNSET)) + + internal_resistance_charge = d.pop("internal_resistance_charge", UNSET) + + internal_resistance_discharge = d.pop("internal_resistance_discharge", UNSET) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_fixed_voltages_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + voltage_max=voltage_max, + voltage_min=voltage_min, + charge_acceptance_limit=charge_acceptance_limit, + charge_release_limit=charge_release_limit, + capacity=capacity, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + state=state, + part_type=part_type, + ) + + battery_fixed_voltages_output.additional_properties = d + return battery_fixed_voltages_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_lookup_table_data.py b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_data.py new file mode 100644 index 00000000..a37d5c6a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_data.py @@ -0,0 +1,175 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatteryLookupTableData") + + +@_attrs_define +class BatteryLookupTableData: + """Data for a lookup table battery.""" + + voltage: list[float] + state_of_charge: list[float] + usable_charge: list[float | None] + power_limit_charge: list[float | None] + power_limit_discharge: list[float | None] + internal_resistance_charge: list[float] + internal_resistance_discharge: list[float] + internal_resistance: list[float] | Unset = UNSET + component_file_type: Literal["BatteryLookupTable"] | Unset = "BatteryLookupTable" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage = self.voltage + + state_of_charge = self.state_of_charge + + usable_charge = [] + for usable_charge_item_data in self.usable_charge: + usable_charge_item: float | None + usable_charge_item = usable_charge_item_data + usable_charge.append(usable_charge_item) + + power_limit_charge = [] + for power_limit_charge_item_data in self.power_limit_charge: + power_limit_charge_item: float | None + power_limit_charge_item = power_limit_charge_item_data + power_limit_charge.append(power_limit_charge_item) + + power_limit_discharge = [] + for power_limit_discharge_item_data in self.power_limit_discharge: + power_limit_discharge_item: float | None + power_limit_discharge_item = power_limit_discharge_item_data + power_limit_discharge.append(power_limit_discharge_item) + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + internal_resistance: list[float] | Unset = UNSET + if not isinstance(self.internal_resistance, Unset): + internal_resistance = self.internal_resistance + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "voltage": voltage, + "state_of_charge": state_of_charge, + "usable_charge": usable_charge, + "power_limit_charge": power_limit_charge, + "power_limit_discharge": power_limit_discharge, + "internal_resistance_charge": internal_resistance_charge, + "internal_resistance_discharge": internal_resistance_discharge, + } + ) + if internal_resistance is not UNSET: + field_dict["internal_resistance"] = internal_resistance + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + voltage = cast(list[float], d.pop("voltage")) + + state_of_charge = cast(list[float], d.pop("state_of_charge")) + + usable_charge = [] + _usable_charge = d.pop("usable_charge") + for usable_charge_item_data in _usable_charge: + + def _parse_usable_charge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + usable_charge_item = _parse_usable_charge_item(usable_charge_item_data) + + usable_charge.append(usable_charge_item) + + power_limit_charge = [] + _power_limit_charge = d.pop("power_limit_charge") + for power_limit_charge_item_data in _power_limit_charge: + + def _parse_power_limit_charge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + power_limit_charge_item = _parse_power_limit_charge_item(power_limit_charge_item_data) + + power_limit_charge.append(power_limit_charge_item) + + power_limit_discharge = [] + _power_limit_discharge = d.pop("power_limit_discharge") + for power_limit_discharge_item_data in _power_limit_discharge: + + def _parse_power_limit_discharge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + power_limit_discharge_item = _parse_power_limit_discharge_item( + power_limit_discharge_item_data + ) + + power_limit_discharge.append(power_limit_discharge_item) + + internal_resistance_charge = cast(list[float], d.pop("internal_resistance_charge")) + + internal_resistance_discharge = cast(list[float], d.pop("internal_resistance_discharge")) + + internal_resistance = cast(list[float], d.pop("internal_resistance", UNSET)) + + component_file_type = cast( + Literal["BatteryLookupTable"] | Unset, d.pop("component_file_type", UNSET) + ) + if component_file_type != "BatteryLookupTable" and not isinstance( + component_file_type, Unset + ): + raise ValueError( + f"component_file_type must match const 'BatteryLookupTable', got '{component_file_type}'" + ) + + battery_lookup_table_data = cls( + voltage=voltage, + state_of_charge=state_of_charge, + usable_charge=usable_charge, + power_limit_charge=power_limit_charge, + power_limit_discharge=power_limit_discharge, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + internal_resistance=internal_resistance, + component_file_type=component_file_type, + ) + + battery_lookup_table_data.additional_properties = d + return battery_lookup_table_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_lookup_table_input.py b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_input.py new file mode 100644 index 00000000..005e2f22 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_input.py @@ -0,0 +1,149 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryLookupTableInput") + + +@_attrs_define +class BatteryLookupTableInput: + """Battery Lookup Table Input.""" + + lookup_table: BatteryLookupTableData + """ Data for a lookup table battery. """ + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Lookup Table Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryLookupData"] | Unset = "BatteryLookupData" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + lookup_table = self.lookup_table.to_dict() + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "lookup_table": lookup_table, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + d = dict(src_dict) + lookup_table = BatteryLookupTableData.from_dict(d.pop("lookup_table")) + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["BatteryLookupData"] | Unset, d.pop("component_type", UNSET)) + if component_type != "BatteryLookupData" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryLookupData', got '{component_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_lookup_table_input = cls( + lookup_table=lookup_table, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + state=state, + part_type=part_type, + ) + + battery_lookup_table_input.additional_properties = d + return battery_lookup_table_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_lookup_table_output.py b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_output.py new file mode 100644 index 00000000..f136276b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_lookup_table_output.py @@ -0,0 +1,156 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryLookupTableOutput") + + +@_attrs_define +class BatteryLookupTableOutput: + """Battery Lookup Table Output.""" + + id: str + lookup_table: BatteryLookupTableData + """ Data for a lookup table battery. """ + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Lookup Table Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryLookupData"] | Unset = "BatteryLookupData" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + lookup_table = self.lookup_table.to_dict() + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "lookup_table": lookup_table, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + d = dict(src_dict) + id = d.pop("id") + + lookup_table = BatteryLookupTableData.from_dict(d.pop("lookup_table")) + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["BatteryLookupData"] | Unset, d.pop("component_type", UNSET)) + if component_type != "BatteryLookupData" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryLookupData', got '{component_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_lookup_table_output = cls( + id=id, + lookup_table=lookup_table, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + state=state, + part_type=part_type, + ) + + battery_lookup_table_output.additional_properties = d + return battery_lookup_table_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/battery_state.py b/schema/generated_client/conceptev_api_client/models/battery_state.py new file mode 100644 index 00000000..0c005f43 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/battery_state.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatteryState") + + +@_attrs_define +class BatteryState: + """Variables that define state of a battery.""" + + temperature: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + temperature: float | None | Unset + if isinstance(self.temperature, Unset): + temperature = UNSET + else: + temperature = self.temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if temperature is not UNSET: + field_dict["temperature"] = temperature + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_temperature(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + temperature = _parse_temperature(d.pop("temperature", UNSET)) + + battery_state = cls( + temperature=temperature, + ) + + battery_state.additional_properties = d + return battery_state + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/body_create_file_item.py b/schema/generated_client/conceptev_api_client/models/body_create_file_item.py new file mode 100644 index 00000000..8dc9194b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/body_create_file_item.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="BodyCreateFileItem") + + +@_attrs_define +class BodyCreateFileItem: + file: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + file = self.file + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "file": file, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("file", (None, str(self.file).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + file = d.pop("file") + + body_create_file_item = cls( + file=file, + ) + + body_create_file_item.additional_properties = d + return body_create_file_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/check_job_backend_availability_response_check_job_backend_availability.py b/schema/generated_client/conceptev_api_client/models/check_job_backend_availability_response_check_job_backend_availability.py new file mode 100644 index 00000000..ece5cb71 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/check_job_backend_availability_response_check_job_backend_availability.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CheckJobBackendAvailabilityResponseCheckJobBackendAvailability") + + +@_attrs_define +class CheckJobBackendAvailabilityResponseCheckJobBackendAvailability: + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + check_job_backend_availability_response_check_job_backend_availability = cls() + + check_job_backend_availability_response_check_job_backend_availability.additional_properties = ( + d + ) + return check_job_backend_availability_response_check_job_backend_availability + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/component_axle.py b/schema/generated_client/conceptev_api_client/models/component_axle.py new file mode 100644 index 00000000..343d676f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/component_axle.py @@ -0,0 +1,15 @@ +from typing import Literal + +ComponentAxle = Literal["Front", "None", "Rear"] + +COMPONENT_AXLE_VALUES: set[ComponentAxle] = { + "Front", + "None", + "Rear", +} + + +def check_component_axle(value: str) -> ComponentAxle: + if value in COMPONENT_AXLE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {COMPONENT_AXLE_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/component_configuration_set.py b/schema/generated_client/conceptev_api_client/models/component_configuration_set.py new file mode 100644 index 00000000..beb6aaf9 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/component_configuration_set.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_configuration import BatteryConfiguration + from ..models.motor_configuration import MotorConfiguration + + +T = TypeVar("T", bound="ComponentConfigurationSet") + + +@_attrs_define +class ComponentConfigurationSet: + """Set of component configurations.""" + + configurations: list[BatteryConfiguration | MotorConfiguration] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_configuration import MotorConfiguration + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, MotorConfiguration): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if configurations is not UNSET: + field_dict["configurations"] = configurations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_configuration import BatteryConfiguration + from ..models.motor_configuration import MotorConfiguration + + d = dict(src_dict) + _configurations = d.pop("configurations", UNSET) + configurations: list[BatteryConfiguration | MotorConfiguration] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item( + data: object, + ) -> BatteryConfiguration | MotorConfiguration: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = MotorConfiguration.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = BatteryConfiguration.from_dict(data) + + return configurations_item_type_1 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + component_configuration_set = cls( + configurations=configurations, + ) + + component_configuration_set.additional_properties = d + return component_configuration_set + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/component_file_type.py b/schema/generated_client/conceptev_api_client/models/component_file_type.py new file mode 100644 index 00000000..924fa91b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/component_file_type.py @@ -0,0 +1,29 @@ +from typing import Literal + +ComponentFileType = Literal[ + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "thermal_model_file", + "transmission_torque_grid_file", +] + +COMPONENT_FILE_TYPE_VALUES: set[ComponentFileType] = { + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "thermal_model_file", + "transmission_torque_grid_file", +} + + +def check_component_file_type(value: str) -> ComponentFileType: + if value in COMPONENT_FILE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {COMPONENT_FILE_TYPE_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/component_loss_map_args.py b/schema/generated_client/conceptev_api_client/models/component_loss_map_args.py new file mode 100644 index 00000000..fbe6da44 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/component_loss_map_args.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ComponentLossMapArgs") + + +@_attrs_define +class ComponentLossMapArgs: + """Args for create component loss maps. + + Allows unit transforming. + + """ + + voltage: float | None | Unset = UNSET + gear_ratio: float | None | Unset = UNSET + speed: float | None | Unset = UNSET + dc_current: float | Unset = 50.0 + power_factor: float | Unset = 1.0 + phase_current_max: float | Unset = 400.0 + frequency: float | Unset = 1000.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage: float | None | Unset + if isinstance(self.voltage, Unset): + voltage = UNSET + else: + voltage = self.voltage + + gear_ratio: float | None | Unset + if isinstance(self.gear_ratio, Unset): + gear_ratio = UNSET + else: + gear_ratio = self.gear_ratio + + speed: float | None | Unset + if isinstance(self.speed, Unset): + speed = UNSET + else: + speed = self.speed + + dc_current = self.dc_current + + power_factor = self.power_factor + + phase_current_max = self.phase_current_max + + frequency = self.frequency + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if voltage is not UNSET: + field_dict["voltage"] = voltage + if gear_ratio is not UNSET: + field_dict["gear_ratio"] = gear_ratio + if speed is not UNSET: + field_dict["speed"] = speed + if dc_current is not UNSET: + field_dict["dc_current"] = dc_current + if power_factor is not UNSET: + field_dict["power_factor"] = power_factor + if phase_current_max is not UNSET: + field_dict["phase_current_max"] = phase_current_max + if frequency is not UNSET: + field_dict["frequency"] = frequency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_voltage(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage = _parse_voltage(d.pop("voltage", UNSET)) + + def _parse_gear_ratio(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + gear_ratio = _parse_gear_ratio(d.pop("gear_ratio", UNSET)) + + def _parse_speed(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + speed = _parse_speed(d.pop("speed", UNSET)) + + dc_current = d.pop("dc_current", UNSET) + + power_factor = d.pop("power_factor", UNSET) + + phase_current_max = d.pop("phase_current_max", UNSET) + + frequency = d.pop("frequency", UNSET) + + component_loss_map_args = cls( + voltage=voltage, + gear_ratio=gear_ratio, + speed=speed, + dc_current=dc_current, + power_factor=power_factor, + phase_current_max=phase_current_max, + frequency=frequency, + ) + + component_loss_map_args.additional_properties = d + return component_loss_map_args + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/concept_input.py b/schema/generated_client/conceptev_api_client/models/concept_input.py new file mode 100644 index 00000000..b2c2aa38 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/concept_input.py @@ -0,0 +1,425 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero_input import AeroInput + from ..models.architecture_input import ArchitectureInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_input import DriveCycleInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.file_item_output import FileItemOutput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + from ..models.static_requirement_input import StaticRequirementInput + from ..models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput + from ..models.wheel_input import WheelInput + + +T = TypeVar("T", bound="ConceptInput") + + +@_attrs_define +class ConceptInput: + """Concept input — uses input variants of each part group.""" + + name: str | Unset = "Study" + user_id: None | str | Unset = UNSET + project_id: None | str | Unset = UNSET + design_id: None | str | Unset = UNSET + design_instance_id: None | str | Unset = UNSET + file_items: list[FileItemOutput] | Unset = UNSET + components: ( + list[ + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ] + | Unset + ) = UNSET + configurations: list[AeroInput | MassInput | WheelInput] | Unset = UNSET + architectures: list[ArchitectureInput] | Unset = UNSET + requirements: ( + list[DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput] | Unset + ) = UNSET + drive_cycles: list[DriveCycleInput] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero_input import AeroInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + + name = self.name + + user_id: None | str | Unset + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + project_id: None | str | Unset + if isinstance(self.project_id, Unset): + project_id = UNSET + else: + project_id = self.project_id + + design_id: None | str | Unset + if isinstance(self.design_id, Unset): + design_id = UNSET + else: + design_id = self.design_id + + design_instance_id: None | str | Unset + if isinstance(self.design_instance_id, Unset): + design_instance_id = UNSET + else: + design_instance_id = self.design_instance_id + + file_items: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.file_items, Unset): + file_items = [] + for file_items_item_data in self.file_items: + file_items_item = file_items_item_data.to_dict() + file_items.append(file_items_item) + + components: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.components, Unset): + components = [] + for components_item_data in self.components: + components_item: dict[str, Any] + if isinstance(components_item_data, MotorLabInput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryFixedVoltagesInput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryLookupTableInput): + components_item = components_item_data.to_dict() + else: + components_item = components_item_data.to_dict() + + components.append(components_item) + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, AeroInput): + configurations_item = configurations_item_data.to_dict() + elif isinstance(configurations_item_data, MassInput): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + architectures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.architectures, Unset): + architectures = [] + for architectures_item_data in self.architectures: + architectures_item = architectures_item_data.to_dict() + architectures.append(architectures_item) + + requirements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.requirements, Unset): + requirements = [] + for requirements_item_data in self.requirements: + requirements_item: dict[str, Any] + if isinstance(requirements_item_data, DriveCycleRequirementInput): + requirements_item = requirements_item_data.to_dict() + elif isinstance(requirements_item_data, DynamicRequirementInput): + requirements_item = requirements_item_data.to_dict() + else: + requirements_item = requirements_item_data.to_dict() + + requirements.append(requirements_item) + + drive_cycles: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.drive_cycles, Unset): + drive_cycles = [] + for drive_cycles_item_data in self.drive_cycles: + drive_cycles_item = drive_cycles_item_data.to_dict() + drive_cycles.append(drive_cycles_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if user_id is not UNSET: + field_dict["user_id"] = user_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if design_id is not UNSET: + field_dict["design_id"] = design_id + if design_instance_id is not UNSET: + field_dict["design_instance_id"] = design_instance_id + if file_items is not UNSET: + field_dict["file_items"] = file_items + if components is not UNSET: + field_dict["components"] = components + if configurations is not UNSET: + field_dict["configurations"] = configurations + if architectures is not UNSET: + field_dict["architectures"] = architectures + if requirements is not UNSET: + field_dict["requirements"] = requirements + if drive_cycles is not UNSET: + field_dict["drive_cycles"] = drive_cycles + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero_input import AeroInput + from ..models.architecture_input import ArchitectureInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_input import DriveCycleInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.file_item_output import FileItemOutput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + from ..models.static_requirement_input import StaticRequirementInput + from ..models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput + from ..models.wheel_input import WheelInput + + d = dict(src_dict) + name = d.pop("name", UNSET) + + def _parse_user_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + def _parse_project_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + project_id = _parse_project_id(d.pop("project_id", UNSET)) + + def _parse_design_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_id = _parse_design_id(d.pop("design_id", UNSET)) + + def _parse_design_instance_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_instance_id = _parse_design_instance_id(d.pop("design_instance_id", UNSET)) + + _file_items = d.pop("file_items", UNSET) + file_items: list[FileItemOutput] | Unset = UNSET + if _file_items is not UNSET: + file_items = [] + for file_items_item_data in _file_items: + file_items_item = FileItemOutput.from_dict(file_items_item_data) + + file_items.append(file_items_item) + + _components = d.pop("components", UNSET) + components: ( + list[ + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ] + | Unset + ) = UNSET + if _components is not UNSET: + components = [] + for components_item_data in _components: + + def _parse_components_item( + data: object, + ) -> ( + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ): + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_0 = MotorLabInput.from_dict(data) + + return components_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_1 = BatteryFixedVoltagesInput.from_dict(data) + + return components_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_2 = BatteryLookupTableInput.from_dict(data) + + return components_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + components_item_type_3 = TransmissionLossCoefficientsInput.from_dict(data) + + return components_item_type_3 + + components_item = _parse_components_item(components_item_data) + + components.append(components_item) + + _configurations = d.pop("configurations", UNSET) + configurations: list[AeroInput | MassInput | WheelInput] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item(data: object) -> AeroInput | MassInput | WheelInput: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = AeroInput.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = MassInput.from_dict(data) + + return configurations_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_2 = WheelInput.from_dict(data) + + return configurations_item_type_2 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + _architectures = d.pop("architectures", UNSET) + architectures: list[ArchitectureInput] | Unset = UNSET + if _architectures is not UNSET: + architectures = [] + for architectures_item_data in _architectures: + architectures_item = ArchitectureInput.from_dict(architectures_item_data) + + architectures.append(architectures_item) + + _requirements = d.pop("requirements", UNSET) + requirements: ( + list[DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput] + | Unset + ) = UNSET + if _requirements is not UNSET: + requirements = [] + for requirements_item_data in _requirements: + + def _parse_requirements_item( + data: object, + ) -> DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput: + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_0 = DriveCycleRequirementInput.from_dict(data) + + return requirements_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_1 = DynamicRequirementInput.from_dict(data) + + return requirements_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_2 = StaticRequirementInput.from_dict(data) + + return requirements_item_type_2 + + requirements_item = _parse_requirements_item(requirements_item_data) + + requirements.append(requirements_item) + + _drive_cycles = d.pop("drive_cycles", UNSET) + drive_cycles: list[DriveCycleInput] | Unset = UNSET + if _drive_cycles is not UNSET: + drive_cycles = [] + for drive_cycles_item_data in _drive_cycles: + drive_cycles_item = DriveCycleInput.from_dict(drive_cycles_item_data) + + drive_cycles.append(drive_cycles_item) + + concept_input = cls( + name=name, + user_id=user_id, + project_id=project_id, + design_id=design_id, + design_instance_id=design_instance_id, + file_items=file_items, + components=components, + configurations=configurations, + architectures=architectures, + requirements=requirements, + drive_cycles=drive_cycles, + ) + + concept_input.additional_properties = d + return concept_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/concept_job_record.py b/schema/generated_client/conceptev_api_client/models/concept_job_record.py new file mode 100644 index 00000000..e7a121fb --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/concept_job_record.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ConceptJobRecord") + + +@_attrs_define +class ConceptJobRecord: + """A job record stored as a part inside a concept. + + Tracks backend job status and the output file URLs written by the solver. + Stored under PartType.JOB so it uses the same CRUD path as all other parts. + + """ + + id: str + name: str + part_type: Literal["job"] | Unset = "job" + status: str | Unset = "RUNNING" + output_urls: list[str] | Unset = UNSET + error: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + part_type = self.part_type + + status = self.status + + output_urls: list[str] | Unset = UNSET + if not isinstance(self.output_urls, Unset): + output_urls = self.output_urls + + error: None | str | Unset + if isinstance(self.error, Unset): + error = UNSET + else: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if status is not UNSET: + field_dict["status"] = status + if output_urls is not UNSET: + field_dict["output_urls"] = output_urls + if error is not UNSET: + field_dict["error"] = error + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + part_type = cast(Literal["job"] | Unset, d.pop("part_type", UNSET)) + if part_type != "job" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'job', got '{part_type}'") + + status = d.pop("status", UNSET) + + output_urls = cast(list[str], d.pop("output_urls", UNSET)) + + def _parse_error(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + error = _parse_error(d.pop("error", UNSET)) + + concept_job_record = cls( + id=id, + name=name, + part_type=part_type, + status=status, + output_urls=output_urls, + error=error, + ) + + concept_job_record.additional_properties = d + return concept_job_record + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/concept_output.py b/schema/generated_client/conceptev_api_client/models/concept_output.py new file mode 100644 index 00000000..1b611ed8 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/concept_output.py @@ -0,0 +1,489 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.save_state import SaveState, check_save_state +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero_output import AeroOutput + from ..models.architecture_output import ArchitectureOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.concept_job_record import ConceptJobRecord + from ..models.drive_cycle_output import DriveCycleOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.file_item_output import FileItemOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + from ..models.static_requirement_output import StaticRequirementOutput + from ..models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput + from ..models.wheel_output import WheelOutput + + +T = TypeVar("T", bound="ConceptOutput") + + +@_attrs_define +class ConceptOutput: + """Concept output with database ID — uses output variants of each part group.""" + + id: str + name: str | Unset = "Study" + user_id: None | str | Unset = UNSET + project_id: None | str | Unset = UNSET + design_id: None | str | Unset = UNSET + design_instance_id: None | str | Unset = UNSET + file_items: list[FileItemOutput] | Unset = UNSET + save_state: SaveState | Unset = UNSET + """ Persistence state of a concept on the filesystem. + + ``UNSAVED`` — concept was created in this session and has never been + written to a user-chosen path (the default for new concepts). + + ``SAVED`` — concept has been explicitly saved to a known path. + + Extending example: add ``MODIFIED`` here when tracking unsaved edits + to an already-saved concept ("dirty" state). """ + components: ( + list[ + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ] + | Unset + ) = UNSET + configurations: list[AeroOutput | MassOutput | WheelOutput] | Unset = UNSET + architectures: list[ArchitectureOutput] | Unset = UNSET + requirements: ( + list[DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput] + | Unset + ) = UNSET + drive_cycles: list[DriveCycleOutput] | Unset = UNSET + jobs: list[ConceptJobRecord] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero_output import AeroOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + + id = self.id + + name = self.name + + user_id: None | str | Unset + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + project_id: None | str | Unset + if isinstance(self.project_id, Unset): + project_id = UNSET + else: + project_id = self.project_id + + design_id: None | str | Unset + if isinstance(self.design_id, Unset): + design_id = UNSET + else: + design_id = self.design_id + + design_instance_id: None | str | Unset + if isinstance(self.design_instance_id, Unset): + design_instance_id = UNSET + else: + design_instance_id = self.design_instance_id + + file_items: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.file_items, Unset): + file_items = [] + for file_items_item_data in self.file_items: + file_items_item = file_items_item_data.to_dict() + file_items.append(file_items_item) + + save_state: str | Unset = UNSET + if not isinstance(self.save_state, Unset): + save_state = self.save_state + + components: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.components, Unset): + components = [] + for components_item_data in self.components: + components_item: dict[str, Any] + if isinstance(components_item_data, MotorLabOutput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryFixedVoltagesOutput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryLookupTableOutput): + components_item = components_item_data.to_dict() + else: + components_item = components_item_data.to_dict() + + components.append(components_item) + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, AeroOutput): + configurations_item = configurations_item_data.to_dict() + elif isinstance(configurations_item_data, MassOutput): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + architectures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.architectures, Unset): + architectures = [] + for architectures_item_data in self.architectures: + architectures_item = architectures_item_data.to_dict() + architectures.append(architectures_item) + + requirements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.requirements, Unset): + requirements = [] + for requirements_item_data in self.requirements: + requirements_item: dict[str, Any] + if isinstance(requirements_item_data, DriveCycleRequirementOutput): + requirements_item = requirements_item_data.to_dict() + elif isinstance(requirements_item_data, DynamicRequirementOutput): + requirements_item = requirements_item_data.to_dict() + else: + requirements_item = requirements_item_data.to_dict() + + requirements.append(requirements_item) + + drive_cycles: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.drive_cycles, Unset): + drive_cycles = [] + for drive_cycles_item_data in self.drive_cycles: + drive_cycles_item = drive_cycles_item_data.to_dict() + drive_cycles.append(drive_cycles_item) + + jobs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.jobs, Unset): + jobs = [] + for jobs_item_data in self.jobs: + jobs_item = jobs_item_data.to_dict() + jobs.append(jobs_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if name is not UNSET: + field_dict["name"] = name + if user_id is not UNSET: + field_dict["user_id"] = user_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if design_id is not UNSET: + field_dict["design_id"] = design_id + if design_instance_id is not UNSET: + field_dict["design_instance_id"] = design_instance_id + if file_items is not UNSET: + field_dict["file_items"] = file_items + if save_state is not UNSET: + field_dict["save_state"] = save_state + if components is not UNSET: + field_dict["components"] = components + if configurations is not UNSET: + field_dict["configurations"] = configurations + if architectures is not UNSET: + field_dict["architectures"] = architectures + if requirements is not UNSET: + field_dict["requirements"] = requirements + if drive_cycles is not UNSET: + field_dict["drive_cycles"] = drive_cycles + if jobs is not UNSET: + field_dict["jobs"] = jobs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero_output import AeroOutput + from ..models.architecture_output import ArchitectureOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.concept_job_record import ConceptJobRecord + from ..models.drive_cycle_output import DriveCycleOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.file_item_output import FileItemOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + from ..models.static_requirement_output import StaticRequirementOutput + from ..models.transmission_loss_coefficients_output import ( + TransmissionLossCoefficientsOutput, + ) + from ..models.wheel_output import WheelOutput + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name", UNSET) + + def _parse_user_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + def _parse_project_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + project_id = _parse_project_id(d.pop("project_id", UNSET)) + + def _parse_design_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_id = _parse_design_id(d.pop("design_id", UNSET)) + + def _parse_design_instance_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_instance_id = _parse_design_instance_id(d.pop("design_instance_id", UNSET)) + + _file_items = d.pop("file_items", UNSET) + file_items: list[FileItemOutput] | Unset = UNSET + if _file_items is not UNSET: + file_items = [] + for file_items_item_data in _file_items: + file_items_item = FileItemOutput.from_dict(file_items_item_data) + + file_items.append(file_items_item) + + _save_state = d.pop("save_state", UNSET) + save_state: SaveState | Unset + if isinstance(_save_state, Unset): + save_state = UNSET + else: + save_state = check_save_state(_save_state) + + _components = d.pop("components", UNSET) + components: ( + list[ + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ] + | Unset + ) = UNSET + if _components is not UNSET: + components = [] + for components_item_data in _components: + + def _parse_components_item( + data: object, + ) -> ( + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_0 = MotorLabOutput.from_dict(data) + + return components_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return components_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_2 = BatteryLookupTableOutput.from_dict(data) + + return components_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + components_item_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return components_item_type_3 + + components_item = _parse_components_item(components_item_data) + + components.append(components_item) + + _configurations = d.pop("configurations", UNSET) + configurations: list[AeroOutput | MassOutput | WheelOutput] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item( + data: object, + ) -> AeroOutput | MassOutput | WheelOutput: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = AeroOutput.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = MassOutput.from_dict(data) + + return configurations_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_2 = WheelOutput.from_dict(data) + + return configurations_item_type_2 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + _architectures = d.pop("architectures", UNSET) + architectures: list[ArchitectureOutput] | Unset = UNSET + if _architectures is not UNSET: + architectures = [] + for architectures_item_data in _architectures: + architectures_item = ArchitectureOutput.from_dict(architectures_item_data) + + architectures.append(architectures_item) + + _requirements = d.pop("requirements", UNSET) + requirements: ( + list[DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput] + | Unset + ) = UNSET + if _requirements is not UNSET: + requirements = [] + for requirements_item_data in _requirements: + + def _parse_requirements_item( + data: object, + ) -> ( + DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return requirements_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_1 = DynamicRequirementOutput.from_dict(data) + + return requirements_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_2 = StaticRequirementOutput.from_dict(data) + + return requirements_item_type_2 + + requirements_item = _parse_requirements_item(requirements_item_data) + + requirements.append(requirements_item) + + _drive_cycles = d.pop("drive_cycles", UNSET) + drive_cycles: list[DriveCycleOutput] | Unset = UNSET + if _drive_cycles is not UNSET: + drive_cycles = [] + for drive_cycles_item_data in _drive_cycles: + drive_cycles_item = DriveCycleOutput.from_dict(drive_cycles_item_data) + + drive_cycles.append(drive_cycles_item) + + _jobs = d.pop("jobs", UNSET) + jobs: list[ConceptJobRecord] | Unset = UNSET + if _jobs is not UNSET: + jobs = [] + for jobs_item_data in _jobs: + jobs_item = ConceptJobRecord.from_dict(jobs_item_data) + + jobs.append(jobs_item) + + concept_output = cls( + id=id, + name=name, + user_id=user_id, + project_id=project_id, + design_id=design_id, + design_instance_id=design_instance_id, + file_items=file_items, + save_state=save_state, + components=components, + configurations=configurations, + architectures=architectures, + requirements=requirements, + drive_cycles=drive_cycles, + jobs=jobs, + ) + + concept_output.additional_properties = d + return concept_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/concept_save_request.py b/schema/generated_client/conceptev_api_client/models/concept_save_request.py new file mode 100644 index 00000000..97d2f8af --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/concept_save_request.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ConceptSaveRequest") + + +@_attrs_define +class ConceptSaveRequest: + """Request body for the save-concept endpoint.""" + + path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + path = self.path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "path": path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + path = d.pop("path") + + concept_save_request = cls( + path=path, + ) + + concept_save_request.additional_properties = d + return concept_save_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/current_unit.py b/schema/generated_client/conceptev_api_client/models/current_unit.py new file mode 100644 index 00000000..2beb9cd7 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/current_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +CurrentUnit = Literal["A", "kA", "mA"] + +CURRENT_UNIT_VALUES: set[CurrentUnit] = { + "A", + "kA", + "mA", +} + + +def check_current_unit(value: str) -> CurrentUnit: + if value in CURRENT_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CURRENT_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/density_unit.py b/schema/generated_client/conceptev_api_client/models/density_unit.py new file mode 100644 index 00000000..cca43569 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/density_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +DensityUnit = Literal["g/cm³", "kg/m³"] + +DENSITY_UNIT_VALUES: set[DensityUnit] = { + "g/cm³", + "kg/m³", +} + + +def check_density_unit(value: str) -> DensityUnit: + if value in DENSITY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DENSITY_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/drive_cycle_input.py b/schema/generated_client/conceptev_api_client/models/drive_cycle_input.py new file mode 100644 index 00000000..73b0dd02 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/drive_cycle_input.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DriveCycleInput") + + +@_attrs_define +class DriveCycleInput: + """Drive Cycle Input. + + Upload the raw drive cycle data (CSV or JSON export from the solver) as a + file first, then create a ``DriveCycleInput`` referencing that file via + ``drive_cycle_data_id``. The ``points`` field is excluded from storage. + + """ + + drive_cycle_data_id: str + item_type: Literal["drive_cycle"] | Unset = "drive_cycle" + name: str | Unset = "" + points: list[Any] | Unset = UNSET + part_type: Literal["drive_cycle"] | Unset = "drive_cycle" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + drive_cycle_data_id = self.drive_cycle_data_id + + item_type = self.item_type + + name = self.name + + points: list[Any] | Unset = UNSET + if not isinstance(self.points, Unset): + points = self.points + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "drive_cycle_data_id": drive_cycle_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if points is not UNSET: + field_dict["points"] = points + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + drive_cycle_data_id = d.pop("drive_cycle_data_id") + + item_type = cast(Literal["drive_cycle"] | Unset, d.pop("item_type", UNSET)) + if item_type != "drive_cycle" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'drive_cycle', got '{item_type}'") + + name = d.pop("name", UNSET) + + points = cast(list[Any], d.pop("points", UNSET)) + + part_type = cast(Literal["drive_cycle"] | Unset, d.pop("part_type", UNSET)) + if part_type != "drive_cycle" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'drive_cycle', got '{part_type}'") + + drive_cycle_input = cls( + drive_cycle_data_id=drive_cycle_data_id, + item_type=item_type, + name=name, + points=points, + part_type=part_type, + ) + + drive_cycle_input.additional_properties = d + return drive_cycle_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/drive_cycle_output.py b/schema/generated_client/conceptev_api_client/models/drive_cycle_output.py new file mode 100644 index 00000000..f59d7647 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/drive_cycle_output.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DriveCycleOutput") + + +@_attrs_define +class DriveCycleOutput: + """Drive Cycle Output. + + The raw time-series data (``points``) is stored in a separate file + referenced by ``drive_cycle_data_id``, mirroring the pattern used by + :class:`~src.v2.models.components.MotorLabOutput`. The ``points`` field + is excluded from the concept record so that large point arrays do not bloat + the concept JSON. + + """ + + id: str + drive_cycle_data_id: str + item_type: Literal["drive_cycle"] | Unset = "drive_cycle" + name: str | Unset = "" + points: list[Any] | Unset = UNSET + part_type: Literal["drive_cycle"] | Unset = "drive_cycle" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + drive_cycle_data_id = self.drive_cycle_data_id + + item_type = self.item_type + + name = self.name + + points: list[Any] | Unset = UNSET + if not isinstance(self.points, Unset): + points = self.points + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "drive_cycle_data_id": drive_cycle_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if points is not UNSET: + field_dict["points"] = points + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + drive_cycle_data_id = d.pop("drive_cycle_data_id") + + item_type = cast(Literal["drive_cycle"] | Unset, d.pop("item_type", UNSET)) + if item_type != "drive_cycle" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'drive_cycle', got '{item_type}'") + + name = d.pop("name", UNSET) + + points = cast(list[Any], d.pop("points", UNSET)) + + part_type = cast(Literal["drive_cycle"] | Unset, d.pop("part_type", UNSET)) + if part_type != "drive_cycle" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'drive_cycle', got '{part_type}'") + + drive_cycle_output = cls( + id=id, + drive_cycle_data_id=drive_cycle_data_id, + item_type=item_type, + name=name, + points=points, + part_type=part_type, + ) + + drive_cycle_output.additional_properties = d + return drive_cycle_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_input.py b/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_input.py new file mode 100644 index 00000000..a7feec06 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_input.py @@ -0,0 +1,330 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DriveCycleRequirementInput") + + +@_attrs_define +class DriveCycleRequirementInput: + """Drive Cycle Requirement Input.""" + + aero_id: str + mass_id: str + wheel_id: str + drive_cycle_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "Requirement" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + requirement_input_type: Literal["drive_cycle"] | Unset = "drive_cycle" + requirement_type: Literal["drive_cycle"] | Unset = "drive_cycle" + solver_id: int | Unset = -1 + drive_cycle: Any | Unset = UNSET + range_: float | None | Unset = UNSET + full_range_calculation: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + drive_cycle_id = self.drive_cycle_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + requirement_input_type = self.requirement_input_type + + requirement_type = self.requirement_type + + solver_id = self.solver_id + + drive_cycle = self.drive_cycle + + range_: float | None | Unset + if isinstance(self.range_, Unset): + range_ = UNSET + else: + range_ = self.range_ + + full_range_calculation = self.full_range_calculation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "drive_cycle_id": drive_cycle_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if requirement_type is not UNSET: + field_dict["requirement_type"] = requirement_type + if solver_id is not UNSET: + field_dict["solver_id"] = solver_id + if drive_cycle is not UNSET: + field_dict["drive_cycle"] = drive_cycle + if range_ is not UNSET: + field_dict["range"] = range_ + if full_range_calculation is not UNSET: + field_dict["full_range_calculation"] = full_range_calculation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + drive_cycle_id = d.pop("drive_cycle_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + requirement_input_type = cast( + Literal["drive_cycle"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "drive_cycle" and not isinstance( + requirement_input_type, Unset + ): + raise ValueError( + f"requirement_input_type must match const 'drive_cycle', got '{requirement_input_type}'" + ) + + requirement_type = cast(Literal["drive_cycle"] | Unset, d.pop("requirement_type", UNSET)) + if requirement_type != "drive_cycle" and not isinstance(requirement_type, Unset): + raise ValueError( + f"requirement_type must match const 'drive_cycle', got '{requirement_type}'" + ) + + solver_id = d.pop("solver_id", UNSET) + + drive_cycle = d.pop("drive_cycle", UNSET) + + def _parse_range_(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + range_ = _parse_range_(d.pop("range", UNSET)) + + full_range_calculation = d.pop("full_range_calculation", UNSET) + + drive_cycle_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + drive_cycle_id=drive_cycle_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + requirement_input_type=requirement_input_type, + requirement_type=requirement_type, + solver_id=solver_id, + drive_cycle=drive_cycle, + range_=range_, + full_range_calculation=full_range_calculation, + ) + + drive_cycle_requirement_input.additional_properties = d + return drive_cycle_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_output.py b/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_output.py new file mode 100644 index 00000000..ad800f75 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/drive_cycle_requirement_output.py @@ -0,0 +1,337 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DriveCycleRequirementOutput") + + +@_attrs_define +class DriveCycleRequirementOutput: + """Drive Cycle Requirement Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + drive_cycle_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "Requirement" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + requirement_input_type: Literal["drive_cycle"] | Unset = "drive_cycle" + requirement_type: Literal["drive_cycle"] | Unset = "drive_cycle" + solver_id: int | Unset = -1 + drive_cycle: Any | Unset = UNSET + range_: float | None | Unset = UNSET + full_range_calculation: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + drive_cycle_id = self.drive_cycle_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + requirement_input_type = self.requirement_input_type + + requirement_type = self.requirement_type + + solver_id = self.solver_id + + drive_cycle = self.drive_cycle + + range_: float | None | Unset + if isinstance(self.range_, Unset): + range_ = UNSET + else: + range_ = self.range_ + + full_range_calculation = self.full_range_calculation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "drive_cycle_id": drive_cycle_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if requirement_type is not UNSET: + field_dict["requirement_type"] = requirement_type + if solver_id is not UNSET: + field_dict["solver_id"] = solver_id + if drive_cycle is not UNSET: + field_dict["drive_cycle"] = drive_cycle + if range_ is not UNSET: + field_dict["range"] = range_ + if full_range_calculation is not UNSET: + field_dict["full_range_calculation"] = full_range_calculation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + drive_cycle_id = d.pop("drive_cycle_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + requirement_input_type = cast( + Literal["drive_cycle"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "drive_cycle" and not isinstance( + requirement_input_type, Unset + ): + raise ValueError( + f"requirement_input_type must match const 'drive_cycle', got '{requirement_input_type}'" + ) + + requirement_type = cast(Literal["drive_cycle"] | Unset, d.pop("requirement_type", UNSET)) + if requirement_type != "drive_cycle" and not isinstance(requirement_type, Unset): + raise ValueError( + f"requirement_type must match const 'drive_cycle', got '{requirement_type}'" + ) + + solver_id = d.pop("solver_id", UNSET) + + drive_cycle = d.pop("drive_cycle", UNSET) + + def _parse_range_(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + range_ = _parse_range_(d.pop("range", UNSET)) + + full_range_calculation = d.pop("full_range_calculation", UNSET) + + drive_cycle_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + drive_cycle_id=drive_cycle_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + requirement_input_type=requirement_input_type, + requirement_type=requirement_type, + solver_id=solver_id, + drive_cycle=drive_cycle, + range_=range_, + full_range_calculation=full_range_calculation, + ) + + drive_cycle_requirement_output.additional_properties = d + return drive_cycle_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/dynamic_requirement_input.py b/schema/generated_client/conceptev_api_client/models/dynamic_requirement_input.py new file mode 100644 index 00000000..0db5f8ff --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/dynamic_requirement_input.py @@ -0,0 +1,373 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DynamicRequirementInput") + + +@_attrs_define +class DynamicRequirementInput: + """Dynamic Requirement Input.""" + + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "D1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + from_speed: float | Unset = 0.0 + to_speed: float | Unset = 1.0 + time_step: float | Unset = 0.1 + no_of_points: int | Unset = 6 + base_speed_ratio: float | Unset = 0.5 + required_time: float | Unset = 10000000000.0 + required_distance: float | Unset = 10000000000.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + max_capability: bool | Unset = False + front_axle_split: float | None | Unset = UNSET + requirement_input_type: Literal["dynamic"] | Unset = "dynamic" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + from_speed = self.from_speed + + to_speed = self.to_speed + + time_step = self.time_step + + no_of_points = self.no_of_points + + base_speed_ratio = self.base_speed_ratio + + required_time = self.required_time + + required_distance = self.required_distance + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + max_capability = self.max_capability + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if from_speed is not UNSET: + field_dict["from_speed"] = from_speed + if to_speed is not UNSET: + field_dict["to_speed"] = to_speed + if time_step is not UNSET: + field_dict["time_step"] = time_step + if no_of_points is not UNSET: + field_dict["no_of_points"] = no_of_points + if base_speed_ratio is not UNSET: + field_dict["base_speed_ratio"] = base_speed_ratio + if required_time is not UNSET: + field_dict["required_time"] = required_time + if required_distance is not UNSET: + field_dict["required_distance"] = required_distance + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if max_capability is not UNSET: + field_dict["max_capability"] = max_capability + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + from_speed = d.pop("from_speed", UNSET) + + to_speed = d.pop("to_speed", UNSET) + + time_step = d.pop("time_step", UNSET) + + no_of_points = d.pop("no_of_points", UNSET) + + base_speed_ratio = d.pop("base_speed_ratio", UNSET) + + required_time = d.pop("required_time", UNSET) + + required_distance = d.pop("required_distance", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + max_capability = d.pop("max_capability", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + requirement_input_type = cast( + Literal["dynamic"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "dynamic" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'dynamic', got '{requirement_input_type}'" + ) + + dynamic_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + from_speed=from_speed, + to_speed=to_speed, + time_step=time_step, + no_of_points=no_of_points, + base_speed_ratio=base_speed_ratio, + required_time=required_time, + required_distance=required_distance, + altitude=altitude, + headwind=headwind, + gradient=gradient, + max_capability=max_capability, + front_axle_split=front_axle_split, + requirement_input_type=requirement_input_type, + ) + + dynamic_requirement_input.additional_properties = d + return dynamic_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/dynamic_requirement_output.py b/schema/generated_client/conceptev_api_client/models/dynamic_requirement_output.py new file mode 100644 index 00000000..201ead38 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/dynamic_requirement_output.py @@ -0,0 +1,380 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DynamicRequirementOutput") + + +@_attrs_define +class DynamicRequirementOutput: + """Dynamic Requirement Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "D1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + from_speed: float | Unset = 0.0 + to_speed: float | Unset = 1.0 + time_step: float | Unset = 0.1 + no_of_points: int | Unset = 6 + base_speed_ratio: float | Unset = 0.5 + required_time: float | Unset = 10000000000.0 + required_distance: float | Unset = 10000000000.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + max_capability: bool | Unset = False + front_axle_split: float | None | Unset = UNSET + requirement_input_type: Literal["dynamic"] | Unset = "dynamic" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + from_speed = self.from_speed + + to_speed = self.to_speed + + time_step = self.time_step + + no_of_points = self.no_of_points + + base_speed_ratio = self.base_speed_ratio + + required_time = self.required_time + + required_distance = self.required_distance + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + max_capability = self.max_capability + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if from_speed is not UNSET: + field_dict["from_speed"] = from_speed + if to_speed is not UNSET: + field_dict["to_speed"] = to_speed + if time_step is not UNSET: + field_dict["time_step"] = time_step + if no_of_points is not UNSET: + field_dict["no_of_points"] = no_of_points + if base_speed_ratio is not UNSET: + field_dict["base_speed_ratio"] = base_speed_ratio + if required_time is not UNSET: + field_dict["required_time"] = required_time + if required_distance is not UNSET: + field_dict["required_distance"] = required_distance + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if max_capability is not UNSET: + field_dict["max_capability"] = max_capability + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + from_speed = d.pop("from_speed", UNSET) + + to_speed = d.pop("to_speed", UNSET) + + time_step = d.pop("time_step", UNSET) + + no_of_points = d.pop("no_of_points", UNSET) + + base_speed_ratio = d.pop("base_speed_ratio", UNSET) + + required_time = d.pop("required_time", UNSET) + + required_distance = d.pop("required_distance", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + max_capability = d.pop("max_capability", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + requirement_input_type = cast( + Literal["dynamic"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "dynamic" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'dynamic', got '{requirement_input_type}'" + ) + + dynamic_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + from_speed=from_speed, + to_speed=to_speed, + time_step=time_step, + no_of_points=no_of_points, + base_speed_ratio=base_speed_ratio, + required_time=required_time, + required_distance=required_distance, + altitude=altitude, + headwind=headwind, + gradient=gradient, + max_capability=max_capability, + front_axle_split=front_axle_split, + requirement_input_type=requirement_input_type, + ) + + dynamic_requirement_output.additional_properties = d + return dynamic_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/edge.py b/schema/generated_client/conceptev_api_client/models/edge.py new file mode 100644 index 00000000..0eb1b1d3 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/edge.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Edge") + + +@_attrs_define +class Edge: + resistance: float + connected_node_list: list[Any] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + resistance = self.resistance + + connected_node_list: list[Any] | Unset = UNSET + if not isinstance(self.connected_node_list, Unset): + connected_node_list = self.connected_node_list + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "resistance": resistance, + } + ) + if connected_node_list is not UNSET: + field_dict["connected_node_list"] = connected_node_list + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + resistance = d.pop("resistance") + + connected_node_list = cast(list[Any], d.pop("connected_node_list", UNSET)) + + edge = cls( + resistance=resistance, + connected_node_list=connected_node_list, + ) + + edge.additional_properties = d + return edge + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/electric_charge_unit.py b/schema/generated_client/conceptev_api_client/models/electric_charge_unit.py new file mode 100644 index 00000000..8f92de22 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/electric_charge_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +ElectricChargeUnit = Literal["A·s"] + +ELECTRIC_CHARGE_UNIT_VALUES: set[ElectricChargeUnit] = { + "A·s", +} + + +def check_electric_charge_unit(value: str) -> ElectricChargeUnit: + if value in ELECTRIC_CHARGE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ELECTRIC_CHARGE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/electrical_energy_unit.py b/schema/generated_client/conceptev_api_client/models/electrical_energy_unit.py new file mode 100644 index 00000000..dfe83b44 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/electrical_energy_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +ElectricalEnergyUnit = Literal["J", "kWh", "VA·hr", "Wh"] + +ELECTRICAL_ENERGY_UNIT_VALUES: set[ElectricalEnergyUnit] = { + "J", + "kWh", + "VA·hr", + "Wh", +} + + +def check_electrical_energy_unit(value: str) -> ElectricalEnergyUnit: + if value in ELECTRICAL_ENERGY_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ELECTRICAL_ENERGY_UNIT_VALUES!r}" + ) diff --git a/schema/generated_client/conceptev_api_client/models/electrical_power_unit.py b/schema/generated_client/conceptev_api_client/models/electrical_power_unit.py new file mode 100644 index 00000000..72df1259 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/electrical_power_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +ElectricalPowerUnit = Literal["kVA", "kW", "VA", "W"] + +ELECTRICAL_POWER_UNIT_VALUES: set[ElectricalPowerUnit] = { + "kVA", + "kW", + "VA", + "W", +} + + +def check_electrical_power_unit(value: str) -> ElectricalPowerUnit: + if value in ELECTRICAL_POWER_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ELECTRICAL_POWER_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/energy_unit.py b/schema/generated_client/conceptev_api_client/models/energy_unit.py new file mode 100644 index 00000000..0ed0cf1b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/energy_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +EnergyUnit = Literal["J", "kJ", "kWh", "mJ", "MJ", "Wh"] + +ENERGY_UNIT_VALUES: set[EnergyUnit] = { + "J", + "kJ", + "kWh", + "mJ", + "MJ", + "Wh", +} + + +def check_energy_unit(value: str) -> EnergyUnit: + if value in ENERGY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ENERGY_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/file_info.py b/schema/generated_client/conceptev_api_client/models/file_info.py new file mode 100644 index 00000000..b8efe544 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/file_info.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileInfo") + + +@_attrs_define +class FileInfo: + """File data model.""" + + id: str + path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + path = self.path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "path": path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + path = d.pop("path") + + file_info = cls( + id=id, + path=path, + ) + + file_info.additional_properties = d + return file_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/file_item_create_response.py b/schema/generated_client/conceptev_api_client/models/file_item_create_response.py new file mode 100644 index 00000000..c784227f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/file_item_create_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.file_item_create_response_calculated_values import ( + FileItemCreateResponseCalculatedValues, + ) + + +T = TypeVar("T", bound="FileItemCreateResponse") + + +@_attrs_define +class FileItemCreateResponse: + """Response from creating a file item. + + Includes any calculated values extracted from the file. + + """ + + name: str + id: str | Unset = UNSET + calculated_values: FileItemCreateResponseCalculatedValues | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + calculated_values: dict[str, Any] | Unset = UNSET + if not isinstance(self.calculated_values, Unset): + calculated_values = self.calculated_values.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if id is not UNSET: + field_dict["id"] = id + if calculated_values is not UNSET: + field_dict["calculated_values"] = calculated_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.file_item_create_response_calculated_values import ( + FileItemCreateResponseCalculatedValues, + ) + + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id", UNSET) + + _calculated_values = d.pop("calculated_values", UNSET) + calculated_values: FileItemCreateResponseCalculatedValues | Unset + if isinstance(_calculated_values, Unset): + calculated_values = UNSET + else: + calculated_values = FileItemCreateResponseCalculatedValues.from_dict(_calculated_values) + + file_item_create_response = cls( + name=name, + id=id, + calculated_values=calculated_values, + ) + + file_item_create_response.additional_properties = d + return file_item_create_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/file_item_create_response_calculated_values.py b/schema/generated_client/conceptev_api_client/models/file_item_create_response_calculated_values.py new file mode 100644 index 00000000..5270553a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/file_item_create_response_calculated_values.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileItemCreateResponseCalculatedValues") + + +@_attrs_define +class FileItemCreateResponseCalculatedValues: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + file_item_create_response_calculated_values = cls() + + file_item_create_response_calculated_values.additional_properties = d + return file_item_create_response_calculated_values + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/file_item_input.py b/schema/generated_client/conceptev_api_client/models/file_item_input.py new file mode 100644 index 00000000..27975f5d --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/file_item_input.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileItemInput") + + +@_attrs_define +class FileItemInput: + """File Item Input — metadata supplied when registering a stored file.""" + + name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + file_item_input = cls( + name=name, + ) + + file_item_input.additional_properties = d + return file_item_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/file_item_output.py b/schema/generated_client/conceptev_api_client/models/file_item_output.py new file mode 100644 index 00000000..6125673b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/file_item_output.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FileItemOutput") + + +@_attrs_define +class FileItemOutput: + """File Item.""" + + name: str + id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id", UNSET) + + file_item_output = cls( + name=name, + id=id, + ) + + file_item_output.additional_properties = d + return file_item_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/force_unit.py b/schema/generated_client/conceptev_api_client/models/force_unit.py new file mode 100644 index 00000000..b02971fb --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/force_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +ForceUnit = Literal["dyn", "lbf", "N"] + +FORCE_UNIT_VALUES: set[ForceUnit] = { + "dyn", + "lbf", + "N", +} + + +def check_force_unit(value: str) -> ForceUnit: + if value in FORCE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FORCE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/frequency_unit.py b/schema/generated_client/conceptev_api_client/models/frequency_unit.py new file mode 100644 index 00000000..495ca5fc --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/frequency_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +FrequencyUnit = Literal["Hz"] + +FREQUENCY_UNIT_VALUES: set[FrequencyUnit] = { + "Hz", +} + + +def check_frequency_unit(value: str) -> FrequencyUnit: + if value in FREQUENCY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FREQUENCY_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py b/schema/generated_client/conceptev_api_client/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py new file mode 100644 index 00000000..c947b155 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet") + + +@_attrs_define +class GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_info_unit_choices_info_get_response_get_info_unit_choices_info_get = cls() + + get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.additional_properties = ( + d + ) + return get_info_unit_choices_info_get_response_get_info_unit_choices_info_get + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/http_validation_error.py b/schema/generated_client/conceptev_api_client/models/http_validation_error.py new file mode 100644 index 00000000..f08fcaca --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/http_validation_error.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error import ValidationError + + +T = TypeVar("T", bound="HTTPValidationError") + + +@_attrs_define +class HTTPValidationError: + detail: list[ValidationError] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + detail: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.detail, Unset): + detail = [] + for detail_item_data in self.detail: + detail_item = detail_item_data.to_dict() + detail.append(detail_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if detail is not UNSET: + field_dict["detail"] = detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error import ValidationError + + d = dict(src_dict) + _detail = d.pop("detail", UNSET) + detail: list[ValidationError] | Unset = UNSET + if _detail is not UNSET: + detail = [] + for detail_item_data in _detail: + detail_item = ValidationError.from_dict(detail_item_data) + + detail.append(detail_item) + + http_validation_error = cls( + detail=detail, + ) + + http_validation_error.additional_properties = d + return http_validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/inertia_unit.py b/schema/generated_client/conceptev_api_client/models/inertia_unit.py new file mode 100644 index 00000000..fd77043f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/inertia_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +InertiaUnit = Literal["g·mm²", "kg·m²"] + +INERTIA_UNIT_VALUES: set[InertiaUnit] = { + "g·mm²", + "kg·m²", +} + + +def check_inertia_unit(value: str) -> InertiaUnit: + if value in INERTIA_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {INERTIA_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/job_output.py b/schema/generated_client/conceptev_api_client/models/job_output.py new file mode 100644 index 00000000..d0b22e54 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/job_output.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.file_info import FileInfo + + +T = TypeVar("T", bound="JobOutput") + + +@_attrs_define +class JobOutput: + """Job result data model.""" + + name: str + id: str + status: str + files: list[FileInfo] | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + status = self.status + + files: list[dict[str, Any]] | None | Unset + if isinstance(self.files, Unset): + files = UNSET + elif isinstance(self.files, list): + files = [] + for files_type_0_item_data in self.files: + files_type_0_item = files_type_0_item_data.to_dict() + files.append(files_type_0_item) + + else: + files = self.files + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "id": id, + "status": status, + } + ) + if files is not UNSET: + field_dict["files"] = files + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.file_info import FileInfo + + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id") + + status = d.pop("status") + + def _parse_files(data: object) -> list[FileInfo] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + files_type_0 = [] + _files_type_0 = data + for files_type_0_item_data in _files_type_0: + files_type_0_item = FileInfo.from_dict(files_type_0_item_data) + + files_type_0.append(files_type_0_item) + + return files_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[FileInfo] | None | Unset, data) + + files = _parse_files(d.pop("files", UNSET)) + + job_output = cls( + name=name, + id=id, + status=status, + files=files, + ) + + job_output.additional_properties = d + return job_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/job_request.py b/schema/generated_client/conceptev_api_client/models/job_request.py new file mode 100644 index 00000000..b2bda639 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/job_request.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="JobRequest") + + +@_attrs_define +class JobRequest: + """Request body for creating a job.""" + + name: str + requirement_ids: list[str] + architecture_id: str + version: str | Unset = "latest" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + requirement_ids = self.requirement_ids + + architecture_id = self.architecture_id + + version = self.version + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "requirement_ids": requirement_ids, + "architecture_id": architecture_id, + } + ) + if version is not UNSET: + field_dict["version"] = version + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + requirement_ids = cast(list[str], d.pop("requirement_ids")) + + architecture_id = d.pop("architecture_id") + + version = d.pop("version", UNSET) + + job_request = cls( + name=name, + requirement_ids=requirement_ids, + architecture_id=architecture_id, + version=version, + ) + + job_request.additional_properties = d + return job_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/length_unit.py b/schema/generated_client/conceptev_api_client/models/length_unit.py new file mode 100644 index 00000000..bd04e797 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/length_unit.py @@ -0,0 +1,20 @@ +from typing import Literal + +LengthUnit = Literal["cm", "ft", "in", "km", "m", "miles", "mm", "yd"] + +LENGTH_UNIT_VALUES: set[LengthUnit] = { + "cm", + "ft", + "in", + "km", + "m", + "miles", + "mm", + "yd", +} + + +def check_length_unit(value: str) -> LengthUnit: + if value in LENGTH_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LENGTH_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/loss_map_grid_lab.py b/schema/generated_client/conceptev_api_client/models/loss_map_grid_lab.py new file mode 100644 index 00000000..bbfe0b64 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/loss_map_grid_lab.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LossMapGridLab") + + +@_attrs_define +class LossMapGridLab: + """Used for Lab motors if no efficiency map included in the .lab file. + + Losses for plotted with current/phase advance or current/slip. + + """ + + currents: list[float] + phase_advances: list[float] | None + slips: list[float] | None + losses_total: list[list[float]] + losses_iron: list[list[float]] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + currents = self.currents + + phase_advances: list[float] | None + if isinstance(self.phase_advances, list): + phase_advances = self.phase_advances + + else: + phase_advances = self.phase_advances + + slips: list[float] | None + if isinstance(self.slips, list): + slips = self.slips + + else: + slips = self.slips + + losses_total = [] + for losses_total_item_data in self.losses_total: + losses_total_item = losses_total_item_data + + losses_total.append(losses_total_item) + + losses_iron = [] + for losses_iron_item_data in self.losses_iron: + losses_iron_item = losses_iron_item_data + + losses_iron.append(losses_iron_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "currents": currents, + "phase_advances": phase_advances, + "slips": slips, + "losses_total": losses_total, + "losses_iron": losses_iron, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + currents = cast(list[float], d.pop("currents")) + + def _parse_phase_advances(data: object) -> list[float] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + phase_advances_type_0 = cast(list[float], data) + + return phase_advances_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[float] | None, data) + + phase_advances = _parse_phase_advances(d.pop("phase_advances")) + + def _parse_slips(data: object) -> list[float] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + slips_type_0 = cast(list[float], data) + + return slips_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[float] | None, data) + + slips = _parse_slips(d.pop("slips")) + + losses_total = [] + _losses_total = d.pop("losses_total") + for losses_total_item_data in _losses_total: + losses_total_item = cast(list[float], losses_total_item_data) + + losses_total.append(losses_total_item) + + losses_iron = [] + _losses_iron = d.pop("losses_iron") + for losses_iron_item_data in _losses_iron: + losses_iron_item = cast(list[float], losses_iron_item_data) + + losses_iron.append(losses_iron_item) + + loss_map_grid_lab = cls( + currents=currents, + phase_advances=phase_advances, + slips=slips, + losses_total=losses_total, + losses_iron=losses_iron, + ) + + loss_map_grid_lab.additional_properties = d + return loss_map_grid_lab + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/loss_map_grid_power.py b/schema/generated_client/conceptev_api_client/models/loss_map_grid_power.py new file mode 100644 index 00000000..1be5da64 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/loss_map_grid_power.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + +T = TypeVar("T", bound="LossMapGridPower") + + +@_attrs_define +class LossMapGridPower: + """Power losses (e.g. motors).""" + + speeds: list[float] + torques: list[float] + losses: list[list[float]] + efficiencies: list[list[float]] + powers: list[list[float]] + meta_data: LossMapGridPowerMetaData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + speeds = self.speeds + + torques = self.torques + + losses = [] + for losses_item_data in self.losses: + losses_item = losses_item_data + + losses.append(losses_item) + + efficiencies = [] + for efficiencies_item_data in self.efficiencies: + efficiencies_item = efficiencies_item_data + + efficiencies.append(efficiencies_item) + + powers = [] + for powers_item_data in self.powers: + powers_item = powers_item_data + + powers.append(powers_item) + + meta_data: dict[str, Any] | None | Unset + if isinstance(self.meta_data, Unset): + meta_data = UNSET + elif isinstance(self.meta_data, LossMapGridPowerMetaData): + meta_data = self.meta_data.to_dict() + else: + meta_data = self.meta_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "speeds": speeds, + "torques": torques, + "losses": losses, + "efficiencies": efficiencies, + "powers": powers, + } + ) + if meta_data is not UNSET: + field_dict["meta_data"] = meta_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + d = dict(src_dict) + speeds = cast(list[float], d.pop("speeds")) + + torques = cast(list[float], d.pop("torques")) + + losses = [] + _losses = d.pop("losses") + for losses_item_data in _losses: + losses_item = cast(list[float], losses_item_data) + + losses.append(losses_item) + + efficiencies = [] + _efficiencies = d.pop("efficiencies") + for efficiencies_item_data in _efficiencies: + efficiencies_item = cast(list[float], efficiencies_item_data) + + efficiencies.append(efficiencies_item) + + powers = [] + _powers = d.pop("powers") + for powers_item_data in _powers: + powers_item = cast(list[float], powers_item_data) + + powers.append(powers_item) + + def _parse_meta_data(data: object) -> LossMapGridPowerMetaData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + meta_data_type_0 = LossMapGridPowerMetaData.from_dict(data) + + return meta_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LossMapGridPowerMetaData | None | Unset, data) + + meta_data = _parse_meta_data(d.pop("meta_data", UNSET)) + + loss_map_grid_power = cls( + speeds=speeds, + torques=torques, + losses=losses, + efficiencies=efficiencies, + powers=powers, + meta_data=meta_data, + ) + + loss_map_grid_power.additional_properties = d + return loss_map_grid_power + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/loss_map_grid_power_meta_data.py b/schema/generated_client/conceptev_api_client/models/loss_map_grid_power_meta_data.py new file mode 100644 index 00000000..9dc2f59b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/loss_map_grid_power_meta_data.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LossMapGridPowerMetaData") + + +@_attrs_define +class LossMapGridPowerMetaData: + """Meta-data for efficiency maps that have been calculated in Lab.""" + + voltage: float + control_strategy_bpm: int | None + control_strategy_sync: int | None + current_limit_line_peak: float + stator_temperature: float + rotor_temperature: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage = self.voltage + + control_strategy_bpm: int | None + control_strategy_bpm = self.control_strategy_bpm + + control_strategy_sync: int | None + control_strategy_sync = self.control_strategy_sync + + current_limit_line_peak = self.current_limit_line_peak + + stator_temperature = self.stator_temperature + + rotor_temperature = self.rotor_temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "voltage": voltage, + "control_strategy_bpm": control_strategy_bpm, + "control_strategy_sync": control_strategy_sync, + "current_limit_line_peak": current_limit_line_peak, + "stator_temperature": stator_temperature, + "rotor_temperature": rotor_temperature, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + voltage = d.pop("voltage") + + def _parse_control_strategy_bpm(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + control_strategy_bpm = _parse_control_strategy_bpm(d.pop("control_strategy_bpm")) + + def _parse_control_strategy_sync(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + control_strategy_sync = _parse_control_strategy_sync(d.pop("control_strategy_sync")) + + current_limit_line_peak = d.pop("current_limit_line_peak") + + stator_temperature = d.pop("stator_temperature") + + rotor_temperature = d.pop("rotor_temperature") + + loss_map_grid_power_meta_data = cls( + voltage=voltage, + control_strategy_bpm=control_strategy_bpm, + control_strategy_sync=control_strategy_sync, + current_limit_line_peak=current_limit_line_peak, + stator_temperature=stator_temperature, + rotor_temperature=rotor_temperature, + ) + + loss_map_grid_power_meta_data.additional_properties = d + return loss_map_grid_power_meta_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/mass.py b/schema/generated_client/conceptev_api_client/models/mass.py new file mode 100644 index 00000000..a72c3812 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/mass.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Mass") + + +@_attrs_define +class Mass: + """Mass Configuration.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + mass = cls( + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + ) + + mass.additional_properties = d + return mass + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/mass_input.py b/schema/generated_client/conceptev_api_client/models/mass_input.py new file mode 100644 index 00000000..433e09d2 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/mass_input.py @@ -0,0 +1,142 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MassInput") + + +@_attrs_define +class MassInput: + """Mass Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + mass_input = cls( + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + part_type=part_type, + ) + + mass_input.additional_properties = d + return mass_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/mass_output.py b/schema/generated_client/conceptev_api_client/models/mass_output.py new file mode 100644 index 00000000..126685f6 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/mass_output.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MassOutput") + + +@_attrs_define +class MassOutput: + """Mass Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + mass_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + part_type=part_type, + ) + + mass_output.additional_properties = d + return mass_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/mass_unit.py b/schema/generated_client/conceptev_api_client/models/mass_unit.py new file mode 100644 index 00000000..ae9f8c4b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/mass_unit.py @@ -0,0 +1,19 @@ +from typing import Literal + +MassUnit = Literal["g", "kg", "lb", "LT", "oz", "t", "tn"] + +MASS_UNIT_VALUES: set[MassUnit] = { + "g", + "kg", + "lb", + "LT", + "oz", + "t", + "tn", +} + + +def check_mass_unit(value: str) -> MassUnit: + if value in MASS_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {MASS_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/motor_configuration.py b/schema/generated_client/conceptev_api_client/models/motor_configuration.py new file mode 100644 index 00000000..450d0066 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_configuration.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.component_axle import ComponentAxle, check_component_axle +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_state import MotorState + + +T = TypeVar("T", bound="MotorConfiguration") + + +@_attrs_define +class MotorConfiguration: + """Configuration that can change characteristics of the motor.""" + + component_config_type: Literal["motor"] | Unset = "motor" + axle: ComponentAxle | Unset = UNSET + """ Component axle. """ + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_config_type = self.component_config_type + + axle: str | Unset = UNSET + if not isinstance(self.axle, Unset): + axle = self.axle + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if component_config_type is not UNSET: + field_dict["component_config_type"] = component_config_type + if axle is not UNSET: + field_dict["axle"] = axle + if state is not UNSET: + field_dict["state"] = state + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_state import MotorState + + d = dict(src_dict) + component_config_type = cast( + Literal["motor"] | Unset, d.pop("component_config_type", UNSET) + ) + if component_config_type != "motor" and not isinstance(component_config_type, Unset): + raise ValueError( + f"component_config_type must match const 'motor', got '{component_config_type}'" + ) + + _axle = d.pop("axle", UNSET) + axle: ComponentAxle | Unset + if isinstance(_axle, Unset): + axle = UNSET + else: + axle = check_component_axle(_axle) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + motor_configuration = cls( + component_config_type=component_config_type, + axle=axle, + state=state, + ) + + motor_configuration.additional_properties = d + return motor_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_lab_data.py b/schema/generated_client/conceptev_api_client/models/motor_lab_data.py new file mode 100644 index 00000000..5870da9b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_lab_data.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data_lab_file_dict import MotorLabDataLabFileDict + + +T = TypeVar("T", bound="MotorLabData") + + +@_attrs_define +class MotorLabData: + """Motor Lab Data. + + Model is held as a dict, exported from Lab. + + """ + + lab_file_dict: MotorLabDataLabFileDict + component_file_type: Literal["MotorLab"] | Unset = "MotorLab" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + lab_file_dict = self.lab_file_dict.to_dict() + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "lab_file_dict": lab_file_dict, + } + ) + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data_lab_file_dict import MotorLabDataLabFileDict + + d = dict(src_dict) + lab_file_dict = MotorLabDataLabFileDict.from_dict(d.pop("lab_file_dict")) + + component_file_type = cast(Literal["MotorLab"] | Unset, d.pop("component_file_type", UNSET)) + if component_file_type != "MotorLab" and not isinstance(component_file_type, Unset): + raise ValueError( + f"component_file_type must match const 'MotorLab', got '{component_file_type}'" + ) + + motor_lab_data = cls( + lab_file_dict=lab_file_dict, + component_file_type=component_file_type, + ) + + motor_lab_data.additional_properties = d + return motor_lab_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_lab_data_lab_file_dict.py b/schema/generated_client/conceptev_api_client/models/motor_lab_data_lab_file_dict.py new file mode 100644 index 00000000..5ad2f0a5 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_lab_data_lab_file_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MotorLabDataLabFileDict") + + +@_attrs_define +class MotorLabDataLabFileDict: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + motor_lab_data_lab_file_dict = cls() + + motor_lab_data_lab_file_dict.additional_properties = d + return motor_lab_data_lab_file_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_lab_input.py b/schema/generated_client/conceptev_api_client/models/motor_lab_input.py new file mode 100644 index 00000000..ce4d46c2 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_lab_input.py @@ -0,0 +1,246 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + +T = TypeVar("T", bound="MotorLabInput") + + +@_attrs_define +class MotorLabInput: + """Motor Lab Input.""" + + max_speed: float + lab_data_id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Component Input" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["MotorLabModel"] | Unset = "MotorLabModel" + lab_data: MotorLabData | None | Unset = UNSET + flow_rate: float | Unset = 0.0 + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + thermal_model: None | ThermalModel | Unset = UNSET + thermal_limits: MotorThermalLimits | Unset = UNSET + """ Thermal limits for motor components. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_lab_data import MotorLabData + from ..models.thermal_model import ThermalModel + + max_speed = self.max_speed + + lab_data_id = self.lab_data_id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + lab_data: dict[str, Any] | None | Unset + if isinstance(self.lab_data, Unset): + lab_data = UNSET + elif isinstance(self.lab_data, MotorLabData): + lab_data = self.lab_data.to_dict() + else: + lab_data = self.lab_data + + flow_rate = self.flow_rate + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + thermal_model: dict[str, Any] | None | Unset + if isinstance(self.thermal_model, Unset): + thermal_model = UNSET + elif isinstance(self.thermal_model, ThermalModel): + thermal_model = self.thermal_model.to_dict() + else: + thermal_model = self.thermal_model + + thermal_limits: dict[str, Any] | Unset = UNSET + if not isinstance(self.thermal_limits, Unset): + thermal_limits = self.thermal_limits.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "max_speed": max_speed, + "lab_data_id": lab_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if lab_data is not UNSET: + field_dict["lab_data"] = lab_data + if flow_rate is not UNSET: + field_dict["flow_rate"] = flow_rate + if state is not UNSET: + field_dict["state"] = state + if thermal_model is not UNSET: + field_dict["thermal_model"] = thermal_model + if thermal_limits is not UNSET: + field_dict["thermal_limits"] = thermal_limits + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + d = dict(src_dict) + max_speed = d.pop("max_speed") + + lab_data_id = d.pop("lab_data_id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["MotorLabModel"] | Unset, d.pop("component_type", UNSET)) + if component_type != "MotorLabModel" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'MotorLabModel', got '{component_type}'" + ) + + def _parse_lab_data(data: object) -> MotorLabData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + lab_data_type_0 = MotorLabData.from_dict(data) + + return lab_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MotorLabData | None | Unset, data) + + lab_data = _parse_lab_data(d.pop("lab_data", UNSET)) + + flow_rate = d.pop("flow_rate", UNSET) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + def _parse_thermal_model(data: object) -> None | ThermalModel | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + thermal_model_type_0 = ThermalModel.from_dict(data) + + return thermal_model_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ThermalModel | Unset, data) + + thermal_model = _parse_thermal_model(d.pop("thermal_model", UNSET)) + + _thermal_limits = d.pop("thermal_limits", UNSET) + thermal_limits: MotorThermalLimits | Unset + if isinstance(_thermal_limits, Unset): + thermal_limits = UNSET + else: + thermal_limits = MotorThermalLimits.from_dict(_thermal_limits) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + motor_lab_input = cls( + max_speed=max_speed, + lab_data_id=lab_data_id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + lab_data=lab_data, + flow_rate=flow_rate, + state=state, + thermal_model=thermal_model, + thermal_limits=thermal_limits, + part_type=part_type, + ) + + motor_lab_input.additional_properties = d + return motor_lab_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_lab_output.py b/schema/generated_client/conceptev_api_client/models/motor_lab_output.py new file mode 100644 index 00000000..4fbc6cab --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_lab_output.py @@ -0,0 +1,253 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + +T = TypeVar("T", bound="MotorLabOutput") + + +@_attrs_define +class MotorLabOutput: + """Motor Lab Output.""" + + id: str + max_speed: float + lab_data_id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Component Input" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["MotorLabModel"] | Unset = "MotorLabModel" + lab_data: MotorLabData | None | Unset = UNSET + flow_rate: float | Unset = 0.0 + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + thermal_model: None | ThermalModel | Unset = UNSET + thermal_limits: MotorThermalLimits | Unset = UNSET + """ Thermal limits for motor components. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_lab_data import MotorLabData + from ..models.thermal_model import ThermalModel + + id = self.id + + max_speed = self.max_speed + + lab_data_id = self.lab_data_id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + lab_data: dict[str, Any] | None | Unset + if isinstance(self.lab_data, Unset): + lab_data = UNSET + elif isinstance(self.lab_data, MotorLabData): + lab_data = self.lab_data.to_dict() + else: + lab_data = self.lab_data + + flow_rate = self.flow_rate + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + thermal_model: dict[str, Any] | None | Unset + if isinstance(self.thermal_model, Unset): + thermal_model = UNSET + elif isinstance(self.thermal_model, ThermalModel): + thermal_model = self.thermal_model.to_dict() + else: + thermal_model = self.thermal_model + + thermal_limits: dict[str, Any] | Unset = UNSET + if not isinstance(self.thermal_limits, Unset): + thermal_limits = self.thermal_limits.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "max_speed": max_speed, + "lab_data_id": lab_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if lab_data is not UNSET: + field_dict["lab_data"] = lab_data + if flow_rate is not UNSET: + field_dict["flow_rate"] = flow_rate + if state is not UNSET: + field_dict["state"] = state + if thermal_model is not UNSET: + field_dict["thermal_model"] = thermal_model + if thermal_limits is not UNSET: + field_dict["thermal_limits"] = thermal_limits + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + d = dict(src_dict) + id = d.pop("id") + + max_speed = d.pop("max_speed") + + lab_data_id = d.pop("lab_data_id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["MotorLabModel"] | Unset, d.pop("component_type", UNSET)) + if component_type != "MotorLabModel" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'MotorLabModel', got '{component_type}'" + ) + + def _parse_lab_data(data: object) -> MotorLabData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + lab_data_type_0 = MotorLabData.from_dict(data) + + return lab_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MotorLabData | None | Unset, data) + + lab_data = _parse_lab_data(d.pop("lab_data", UNSET)) + + flow_rate = d.pop("flow_rate", UNSET) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + def _parse_thermal_model(data: object) -> None | ThermalModel | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + thermal_model_type_0 = ThermalModel.from_dict(data) + + return thermal_model_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ThermalModel | Unset, data) + + thermal_model = _parse_thermal_model(d.pop("thermal_model", UNSET)) + + _thermal_limits = d.pop("thermal_limits", UNSET) + thermal_limits: MotorThermalLimits | Unset + if isinstance(_thermal_limits, Unset): + thermal_limits = UNSET + else: + thermal_limits = MotorThermalLimits.from_dict(_thermal_limits) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + motor_lab_output = cls( + id=id, + max_speed=max_speed, + lab_data_id=lab_data_id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + lab_data=lab_data, + flow_rate=flow_rate, + state=state, + thermal_model=thermal_model, + thermal_limits=thermal_limits, + part_type=part_type, + ) + + motor_lab_output.additional_properties = d + return motor_lab_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_state.py b/schema/generated_client/conceptev_api_client/models/motor_state.py new file mode 100644 index 00000000..63efe140 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_state.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MotorState") + + +@_attrs_define +class MotorState: + """Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. + + """ + + stator_winding_temp: float | None | Unset = UNSET + stator_winding_temp_peak: float | None | Unset = UNSET + rotor_temp: float | None | Unset = UNSET + stator_current_limit: float | None | Unset = UNSET + airgap_temp: float | None | Unset = UNSET + bearing_temp_front: float | None | Unset = UNSET + bearing_temp_rear: float | None | Unset = UNSET + control_strategy_bpm: int | None | Unset = UNSET + control_strategy_sync: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + stator_winding_temp: float | None | Unset + if isinstance(self.stator_winding_temp, Unset): + stator_winding_temp = UNSET + else: + stator_winding_temp = self.stator_winding_temp + + stator_winding_temp_peak: float | None | Unset + if isinstance(self.stator_winding_temp_peak, Unset): + stator_winding_temp_peak = UNSET + else: + stator_winding_temp_peak = self.stator_winding_temp_peak + + rotor_temp: float | None | Unset + if isinstance(self.rotor_temp, Unset): + rotor_temp = UNSET + else: + rotor_temp = self.rotor_temp + + stator_current_limit: float | None | Unset + if isinstance(self.stator_current_limit, Unset): + stator_current_limit = UNSET + else: + stator_current_limit = self.stator_current_limit + + airgap_temp: float | None | Unset + if isinstance(self.airgap_temp, Unset): + airgap_temp = UNSET + else: + airgap_temp = self.airgap_temp + + bearing_temp_front: float | None | Unset + if isinstance(self.bearing_temp_front, Unset): + bearing_temp_front = UNSET + else: + bearing_temp_front = self.bearing_temp_front + + bearing_temp_rear: float | None | Unset + if isinstance(self.bearing_temp_rear, Unset): + bearing_temp_rear = UNSET + else: + bearing_temp_rear = self.bearing_temp_rear + + control_strategy_bpm: int | None | Unset + if isinstance(self.control_strategy_bpm, Unset): + control_strategy_bpm = UNSET + else: + control_strategy_bpm = self.control_strategy_bpm + + control_strategy_sync: int | None | Unset + if isinstance(self.control_strategy_sync, Unset): + control_strategy_sync = UNSET + else: + control_strategy_sync = self.control_strategy_sync + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if stator_winding_temp is not UNSET: + field_dict["stator_winding_temp"] = stator_winding_temp + if stator_winding_temp_peak is not UNSET: + field_dict["stator_winding_temp_peak"] = stator_winding_temp_peak + if rotor_temp is not UNSET: + field_dict["rotor_temp"] = rotor_temp + if stator_current_limit is not UNSET: + field_dict["stator_current_limit"] = stator_current_limit + if airgap_temp is not UNSET: + field_dict["airgap_temp"] = airgap_temp + if bearing_temp_front is not UNSET: + field_dict["bearing_temp_front"] = bearing_temp_front + if bearing_temp_rear is not UNSET: + field_dict["bearing_temp_rear"] = bearing_temp_rear + if control_strategy_bpm is not UNSET: + field_dict["control_strategy_bpm"] = control_strategy_bpm + if control_strategy_sync is not UNSET: + field_dict["control_strategy_sync"] = control_strategy_sync + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_stator_winding_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_winding_temp = _parse_stator_winding_temp(d.pop("stator_winding_temp", UNSET)) + + def _parse_stator_winding_temp_peak(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_winding_temp_peak = _parse_stator_winding_temp_peak( + d.pop("stator_winding_temp_peak", UNSET) + ) + + def _parse_rotor_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + rotor_temp = _parse_rotor_temp(d.pop("rotor_temp", UNSET)) + + def _parse_stator_current_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_current_limit = _parse_stator_current_limit(d.pop("stator_current_limit", UNSET)) + + def _parse_airgap_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + airgap_temp = _parse_airgap_temp(d.pop("airgap_temp", UNSET)) + + def _parse_bearing_temp_front(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + bearing_temp_front = _parse_bearing_temp_front(d.pop("bearing_temp_front", UNSET)) + + def _parse_bearing_temp_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + bearing_temp_rear = _parse_bearing_temp_rear(d.pop("bearing_temp_rear", UNSET)) + + def _parse_control_strategy_bpm(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + control_strategy_bpm = _parse_control_strategy_bpm(d.pop("control_strategy_bpm", UNSET)) + + def _parse_control_strategy_sync(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + control_strategy_sync = _parse_control_strategy_sync(d.pop("control_strategy_sync", UNSET)) + + motor_state = cls( + stator_winding_temp=stator_winding_temp, + stator_winding_temp_peak=stator_winding_temp_peak, + rotor_temp=rotor_temp, + stator_current_limit=stator_current_limit, + airgap_temp=airgap_temp, + bearing_temp_front=bearing_temp_front, + bearing_temp_rear=bearing_temp_rear, + control_strategy_bpm=control_strategy_bpm, + control_strategy_sync=control_strategy_sync, + ) + + motor_state.additional_properties = d + return motor_state + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/motor_thermal_limits.py b/schema/generated_client/conceptev_api_client/models/motor_thermal_limits.py new file mode 100644 index 00000000..6d03bfee --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/motor_thermal_limits.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MotorThermalLimits") + + +@_attrs_define +class MotorThermalLimits: + """Thermal limits for motor components.""" + + stator: float | None | Unset = UNSET + rotor: float | None | Unset = UNSET + stator_limit_type: str | Unset = "average" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + stator: float | None | Unset + if isinstance(self.stator, Unset): + stator = UNSET + else: + stator = self.stator + + rotor: float | None | Unset + if isinstance(self.rotor, Unset): + rotor = UNSET + else: + rotor = self.rotor + + stator_limit_type = self.stator_limit_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if stator is not UNSET: + field_dict["stator"] = stator + if rotor is not UNSET: + field_dict["rotor"] = rotor + if stator_limit_type is not UNSET: + field_dict["stator_limit_type"] = stator_limit_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_stator(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator = _parse_stator(d.pop("stator", UNSET)) + + def _parse_rotor(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + rotor = _parse_rotor(d.pop("rotor", UNSET)) + + stator_limit_type = d.pop("stator_limit_type", UNSET) + + motor_thermal_limits = cls( + stator=stator, + rotor=rotor, + stator_limit_type=stator_limit_type, + ) + + motor_thermal_limits.additional_properties = d + return motor_thermal_limits + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/node.py b/schema/generated_client/conceptev_api_client/models/node.py new file mode 100644 index 00000000..6d2d4be3 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/node.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Node") + + +@_attrs_define +class Node: + uid: int + name: str + capacitance: float | Unset = 0.0 + fixed_temperature: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uid = self.uid + + name = self.name + + capacitance = self.capacitance + + fixed_temperature: float | None | Unset + if isinstance(self.fixed_temperature, Unset): + fixed_temperature = UNSET + else: + fixed_temperature = self.fixed_temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "uid": uid, + "name": name, + } + ) + if capacitance is not UNSET: + field_dict["capacitance"] = capacitance + if fixed_temperature is not UNSET: + field_dict["fixed_temperature"] = fixed_temperature + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + uid = d.pop("uid") + + name = d.pop("name") + + capacitance = d.pop("capacitance", UNSET) + + def _parse_fixed_temperature(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + fixed_temperature = _parse_fixed_temperature(d.pop("fixed_temperature", UNSET)) + + node = cls( + uid=uid, + name=name, + capacitance=capacitance, + fixed_temperature=fixed_temperature, + ) + + node.additional_properties = d + return node + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/part_type.py b/schema/generated_client/conceptev_api_client/models/part_type.py new file mode 100644 index 00000000..3cea238f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/part_type.py @@ -0,0 +1,20 @@ +from typing import Literal + +PartType = Literal[ + "architecture", "component", "configuration", "drive_cycle", "job", "requirement" +] + +PART_TYPE_VALUES: set[PartType] = { + "architecture", + "component", + "configuration", + "drive_cycle", + "job", + "requirement", +} + + +def check_part_type(value: str) -> PartType: + if value in PART_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PART_TYPE_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/power_unit.py b/schema/generated_client/conceptev_api_client/models/power_unit.py new file mode 100644 index 00000000..1b6cbf14 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/power_unit.py @@ -0,0 +1,17 @@ +from typing import Literal + +PowerUnit = Literal["hp", "kW", "mW", "MW", "W"] + +POWER_UNIT_VALUES: set[PowerUnit] = { + "hp", + "kW", + "mW", + "MW", + "W", +} + + +def check_power_unit(value: str) -> PowerUnit: + if value in POWER_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {POWER_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/pressure_unit.py b/schema/generated_client/conceptev_api_client/models/pressure_unit.py new file mode 100644 index 00000000..9eb95534 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/pressure_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +PressureUnit = Literal["kPa", "MPa", "Pa", "psi"] + +PRESSURE_UNIT_VALUES: set[PressureUnit] = { + "kPa", + "MPa", + "Pa", + "psi", +} + + +def check_pressure_unit(value: str) -> PressureUnit: + if value in PRESSURE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRESSURE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/ratio_unit.py b/schema/generated_client/conceptev_api_client/models/ratio_unit.py new file mode 100644 index 00000000..d6a28f2d --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/ratio_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +RatioUnit = Literal["", "%"] + +RATIO_UNIT_VALUES: set[RatioUnit] = { + "", + "%", +} + + +def check_ratio_unit(value: str) -> RatioUnit: + if value in RATIO_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {RATIO_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/resistance_unit.py b/schema/generated_client/conceptev_api_client/models/resistance_unit.py new file mode 100644 index 00000000..93937467 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/resistance_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +ResistanceUnit = Literal["ohm"] + +RESISTANCE_UNIT_VALUES: set[ResistanceUnit] = { + "ohm", +} + + +def check_resistance_unit(value: str) -> ResistanceUnit: + if value in RESISTANCE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {RESISTANCE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/road_efficiency_unit.py b/schema/generated_client/conceptev_api_client/models/road_efficiency_unit.py new file mode 100644 index 00000000..383e4576 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/road_efficiency_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +RoadEfficiencyUnit = Literal["km/kWh", "m/J", "miles/kWh", "MPGe"] + +ROAD_EFFICIENCY_UNIT_VALUES: set[RoadEfficiencyUnit] = { + "km/kWh", + "m/J", + "miles/kWh", + "MPGe", +} + + +def check_road_efficiency_unit(value: str) -> RoadEfficiencyUnit: + if value in ROAD_EFFICIENCY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ROAD_EFFICIENCY_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/save_state.py b/schema/generated_client/conceptev_api_client/models/save_state.py new file mode 100644 index 00000000..e2a56fc5 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/save_state.py @@ -0,0 +1,14 @@ +from typing import Literal + +SaveState = Literal["saved", "unsaved"] + +SAVE_STATE_VALUES: set[SaveState] = { + "saved", + "unsaved", +} + + +def check_save_state(value: str) -> SaveState: + if value in SAVE_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SAVE_STATE_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/speed_unit.py b/schema/generated_client/conceptev_api_client/models/speed_unit.py new file mode 100644 index 00000000..1a80f189 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/speed_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +SpeedUnit = Literal["ft/s", "km/hr", "m/s", "mph"] + +SPEED_UNIT_VALUES: set[SpeedUnit] = { + "ft/s", + "km/hr", + "m/s", + "mph", +} + + +def check_speed_unit(value: str) -> SpeedUnit: + if value in SPEED_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SPEED_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/static_requirement_input.py b/schema/generated_client/conceptev_api_client/models/static_requirement_input.py new file mode 100644 index 00000000..54de9072 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/static_requirement_input.py @@ -0,0 +1,309 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="StaticRequirementInput") + + +@_attrs_define +class StaticRequirementInput: + """Static Requirement (Acceleration) Input.""" + + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "S1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + speed: float | Unset = 10.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + front_axle_split: float | None | Unset = UNSET + steady_state: bool | Unset = False + requirement_input_type: Literal["static"] | Unset = "static" + acceleration: float | Unset = 1.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + speed = self.speed + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + steady_state = self.steady_state + + requirement_input_type = self.requirement_input_type + + acceleration = self.acceleration + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if speed is not UNSET: + field_dict["speed"] = speed + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if steady_state is not UNSET: + field_dict["steady_state"] = steady_state + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if acceleration is not UNSET: + field_dict["acceleration"] = acceleration + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + speed = d.pop("speed", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + steady_state = d.pop("steady_state", UNSET) + + requirement_input_type = cast( + Literal["static"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "static" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'static', got '{requirement_input_type}'" + ) + + acceleration = d.pop("acceleration", UNSET) + + static_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + speed=speed, + altitude=altitude, + headwind=headwind, + gradient=gradient, + front_axle_split=front_axle_split, + steady_state=steady_state, + requirement_input_type=requirement_input_type, + acceleration=acceleration, + ) + + static_requirement_input.additional_properties = d + return static_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/static_requirement_output.py b/schema/generated_client/conceptev_api_client/models/static_requirement_output.py new file mode 100644 index 00000000..d4b2f31a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/static_requirement_output.py @@ -0,0 +1,314 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="StaticRequirementOutput") + + +@_attrs_define +class StaticRequirementOutput: + """Static Requirement (Acceleration) Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + speed: float + acceleration: float + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "S1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + front_axle_split: float | None | Unset = UNSET + steady_state: bool | Unset = False + requirement_input_type: Literal["static"] | Unset = "static" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + speed = self.speed + + acceleration = self.acceleration + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + steady_state = self.steady_state + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "speed": speed, + "acceleration": acceleration, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if steady_state is not UNSET: + field_dict["steady_state"] = steady_state + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + speed = d.pop("speed") + + acceleration = d.pop("acceleration") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + steady_state = d.pop("steady_state", UNSET) + + requirement_input_type = cast( + Literal["static"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "static" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'static', got '{requirement_input_type}'" + ) + + static_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + speed=speed, + acceleration=acceleration, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + altitude=altitude, + headwind=headwind, + gradient=gradient, + front_axle_split=front_axle_split, + steady_state=steady_state, + requirement_input_type=requirement_input_type, + ) + + static_requirement_output.additional_properties = d + return static_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/surface_condition_traction_configs.py b/schema/generated_client/conceptev_api_client/models/surface_condition_traction_configs.py new file mode 100644 index 00000000..ac1767bb --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/surface_condition_traction_configs.py @@ -0,0 +1,17 @@ +from typing import Literal + +SurfaceConditionTractionConfigs = Literal["Dry", "Snow", "Wet"] + +SURFACE_CONDITION_TRACTION_CONFIGS_VALUES: set[SurfaceConditionTractionConfigs] = { + "Dry", + "Snow", + "Wet", +} + + +def check_surface_condition_traction_configs(value: str) -> SurfaceConditionTractionConfigs: + if value in SURFACE_CONDITION_TRACTION_CONFIGS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {SURFACE_CONDITION_TRACTION_CONFIGS_VALUES!r}" + ) diff --git a/schema/generated_client/conceptev_api_client/models/temperature_unit.py b/schema/generated_client/conceptev_api_client/models/temperature_unit.py new file mode 100644 index 00000000..9c2e10ac --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/temperature_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +TemperatureUnit = Literal["K", "°C", "°F"] + +TEMPERATURE_UNIT_VALUES: set[TemperatureUnit] = { + "K", + "°C", + "°F", +} + + +def check_temperature_unit(value: str) -> TemperatureUnit: + if value in TEMPERATURE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TEMPERATURE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/thermal_model.py b/schema/generated_client/conceptev_api_client/models/thermal_model.py new file mode 100644 index 00000000..9c058339 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_model.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.thermal_model_loss_map import ThermalModelLossMap + from ..models.thermal_model_temperature_map import ThermalModelTemperatureMap + from ..models.thermal_network import ThermalNetwork + + +T = TypeVar("T", bound="ThermalModel") + + +@_attrs_define +class ThermalModel: + """Thermal model. + + Contains the thermal network defined by nodes and edges, and mappings of which nodes + correspond to which losses and temperatures. + + """ + + network: ThermalNetwork + """ Lumped parameter thermal network. + + It is constructed from sets of nodes and edges (connections) at different speeds + and flow rates. + + Fields: + speed_dict (dict): Dictionary mapping indices to speed values. + flow_rate_dict (dict): Dictionary mapping indices to flow rate values. + edges (dict): Dictionary mapping indices to edge lists. + nodes (dict): Dictionary mapping indices to node lists. """ + loss_map: ThermalModelLossMap + temperature_map: ThermalModelTemperatureMap + component_file_type: Literal["ThermalModel"] | Unset = "ThermalModel" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + network = self.network.to_dict() + + loss_map = self.loss_map.to_dict() + + temperature_map = self.temperature_map.to_dict() + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "network": network, + "loss_map": loss_map, + "temperature_map": temperature_map, + } + ) + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_loss_map import ThermalModelLossMap + from ..models.thermal_model_temperature_map import ThermalModelTemperatureMap + from ..models.thermal_network import ThermalNetwork + + d = dict(src_dict) + network = ThermalNetwork.from_dict(d.pop("network")) + + loss_map = ThermalModelLossMap.from_dict(d.pop("loss_map")) + + temperature_map = ThermalModelTemperatureMap.from_dict(d.pop("temperature_map")) + + component_file_type = cast( + Literal["ThermalModel"] | Unset, d.pop("component_file_type", UNSET) + ) + if component_file_type != "ThermalModel" and not isinstance(component_file_type, Unset): + raise ValueError( + f"component_file_type must match const 'ThermalModel', got '{component_file_type}'" + ) + + thermal_model = cls( + network=network, + loss_map=loss_map, + temperature_map=temperature_map, + component_file_type=component_file_type, + ) + + thermal_model.additional_properties = d + return thermal_model + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map.py b/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map.py new file mode 100644 index 00000000..856eadb9 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_model_loss_map_additional_property import ( + ThermalModelLossMapAdditionalProperty, + ) + + +T = TypeVar("T", bound="ThermalModelLossMap") + + +@_attrs_define +class ThermalModelLossMap: + additional_properties: dict[str, ThermalModelLossMapAdditionalProperty] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_loss_map_additional_property import ( + ThermalModelLossMapAdditionalProperty, + ) + + d = dict(src_dict) + thermal_model_loss_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ThermalModelLossMapAdditionalProperty.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + thermal_model_loss_map.additional_properties = additional_properties + return thermal_model_loss_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ThermalModelLossMapAdditionalProperty: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ThermalModelLossMapAdditionalProperty) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map_additional_property.py b/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map_additional_property.py new file mode 100644 index 00000000..c7c31bdc --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_model_loss_map_additional_property.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalModelLossMapAdditionalProperty") + + +@_attrs_define +class ThermalModelLossMapAdditionalProperty: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_model_loss_map_additional_property = cls() + + thermal_model_loss_map_additional_property.additional_properties = d + return thermal_model_loss_map_additional_property + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map.py b/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map.py new file mode 100644 index 00000000..66fcdc08 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, + ) + + +T = TypeVar("T", bound="ThermalModelTemperatureMap") + + +@_attrs_define +class ThermalModelTemperatureMap: + additional_properties: dict[str, ThermalModelTemperatureMapAdditionalProperty] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, + ) + + d = dict(src_dict) + thermal_model_temperature_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ThermalModelTemperatureMapAdditionalProperty.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + thermal_model_temperature_map.additional_properties = additional_properties + return thermal_model_temperature_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ThermalModelTemperatureMapAdditionalProperty: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ThermalModelTemperatureMapAdditionalProperty) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map_additional_property.py b/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map_additional_property.py new file mode 100644 index 00000000..be35665f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_model_temperature_map_additional_property.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalModelTemperatureMapAdditionalProperty") + + +@_attrs_define +class ThermalModelTemperatureMapAdditionalProperty: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_model_temperature_map_additional_property = cls() + + thermal_model_temperature_map_additional_property.additional_properties = d + return thermal_model_temperature_map_additional_property + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_network.py b/schema/generated_client/conceptev_api_client/models/thermal_network.py new file mode 100644 index 00000000..dce931f2 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_network.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_network_edges import ThermalNetworkEdges + from ..models.thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict + from ..models.thermal_network_nodes import ThermalNetworkNodes + from ..models.thermal_network_speed_dict import ThermalNetworkSpeedDict + + +T = TypeVar("T", bound="ThermalNetwork") + + +@_attrs_define +class ThermalNetwork: + """Lumped parameter thermal network. + + It is constructed from sets of nodes and edges (connections) at different speeds + and flow rates. + + Fields: + speed_dict (dict): Dictionary mapping indices to speed values. + flow_rate_dict (dict): Dictionary mapping indices to flow rate values. + edges (dict): Dictionary mapping indices to edge lists. + nodes (dict): Dictionary mapping indices to node lists. + + """ + + edges: ThermalNetworkEdges + nodes: ThermalNetworkNodes + speed_dict: ThermalNetworkSpeedDict + flow_rate_dict: ThermalNetworkFlowRateDict + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + edges = self.edges.to_dict() + + nodes = self.nodes.to_dict() + + speed_dict = self.speed_dict.to_dict() + + flow_rate_dict = self.flow_rate_dict.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "edges": edges, + "nodes": nodes, + "speed_dict": speed_dict, + "flow_rate_dict": flow_rate_dict, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_network_edges import ThermalNetworkEdges + from ..models.thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict + from ..models.thermal_network_nodes import ThermalNetworkNodes + from ..models.thermal_network_speed_dict import ThermalNetworkSpeedDict + + d = dict(src_dict) + edges = ThermalNetworkEdges.from_dict(d.pop("edges")) + + nodes = ThermalNetworkNodes.from_dict(d.pop("nodes")) + + speed_dict = ThermalNetworkSpeedDict.from_dict(d.pop("speed_dict")) + + flow_rate_dict = ThermalNetworkFlowRateDict.from_dict(d.pop("flow_rate_dict")) + + thermal_network = cls( + edges=edges, + nodes=nodes, + speed_dict=speed_dict, + flow_rate_dict=flow_rate_dict, + ) + + thermal_network.additional_properties = d + return thermal_network + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_network_edges.py b/schema/generated_client/conceptev_api_client/models/thermal_network_edges.py new file mode 100644 index 00000000..5c9613fa --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_network_edges.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.edge import Edge + + +T = TypeVar("T", bound="ThermalNetworkEdges") + + +@_attrs_define +class ThermalNetworkEdges: + additional_properties: dict[str, list[Edge]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = [] + for additional_property_item_data in prop: + additional_property_item = additional_property_item_data.to_dict() + field_dict[prop_name].append(additional_property_item) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.edge import Edge + + d = dict(src_dict) + thermal_network_edges = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = [] + _additional_property = prop_dict + for additional_property_item_data in _additional_property: + additional_property_item = Edge.from_dict(additional_property_item_data) + + additional_property.append(additional_property_item) + + additional_properties[prop_name] = additional_property + + thermal_network_edges.additional_properties = additional_properties + return thermal_network_edges + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[Edge]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[Edge]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_network_flow_rate_dict.py b/schema/generated_client/conceptev_api_client/models/thermal_network_flow_rate_dict.py new file mode 100644 index 00000000..01cc6cfe --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_network_flow_rate_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalNetworkFlowRateDict") + + +@_attrs_define +class ThermalNetworkFlowRateDict: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_network_flow_rate_dict = cls() + + thermal_network_flow_rate_dict.additional_properties = d + return thermal_network_flow_rate_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_network_nodes.py b/schema/generated_client/conceptev_api_client/models/thermal_network_nodes.py new file mode 100644 index 00000000..3b7b407c --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_network_nodes.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.node import Node + + +T = TypeVar("T", bound="ThermalNetworkNodes") + + +@_attrs_define +class ThermalNetworkNodes: + additional_properties: dict[str, list[Node]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = [] + for additional_property_item_data in prop: + additional_property_item = additional_property_item_data.to_dict() + field_dict[prop_name].append(additional_property_item) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node import Node + + d = dict(src_dict) + thermal_network_nodes = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = [] + _additional_property = prop_dict + for additional_property_item_data in _additional_property: + additional_property_item = Node.from_dict(additional_property_item_data) + + additional_property.append(additional_property_item) + + additional_properties[prop_name] = additional_property + + thermal_network_nodes.additional_properties = additional_properties + return thermal_network_nodes + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[Node]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[Node]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/thermal_network_speed_dict.py b/schema/generated_client/conceptev_api_client/models/thermal_network_speed_dict.py new file mode 100644 index 00000000..04d3db0f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/thermal_network_speed_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalNetworkSpeedDict") + + +@_attrs_define +class ThermalNetworkSpeedDict: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_network_speed_dict = cls() + + thermal_network_speed_dict.additional_properties = d + return thermal_network_speed_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/time_unit.py b/schema/generated_client/conceptev_api_client/models/time_unit.py new file mode 100644 index 00000000..db41cad5 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/time_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +TimeUnit = Literal["hr", "min", "ms", "s"] + +TIME_UNIT_VALUES: set[TimeUnit] = { + "hr", + "min", + "ms", + "s", +} + + +def check_time_unit(value: str) -> TimeUnit: + if value in TIME_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TIME_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/torque_unit.py b/schema/generated_client/conceptev_api_client/models/torque_unit.py new file mode 100644 index 00000000..fd3290da --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/torque_unit.py @@ -0,0 +1,17 @@ +from typing import Literal + +TorqueUnit = Literal["dyn·cm", "ft·lbf", "kN·m", "MN·m", "N·m"] + +TORQUE_UNIT_VALUES: set[TorqueUnit] = { + "dyn·cm", + "ft·lbf", + "kN·m", + "MN·m", + "N·m", +} + + +def check_torque_unit(value: str) -> TorqueUnit: + if value in TORQUE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TORQUE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_input.py b/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_input.py new file mode 100644 index 00000000..eb70bec7 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_input.py @@ -0,0 +1,217 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + +T = TypeVar("T", bound="TotalTractiveTorqueGraphInput") + + +@_attrs_define +class TotalTractiveTorqueGraphInput: + """Total Tractive Torque Graph Input.""" + + max_speed: float + step_size_speed: float + acceleration: float + altitude: float + headwind: float + gradient: float + aero_id: str + mass_id: str + wheel_id: str + mass: Mass | None | Unset = UNSET + aero: Aero | None | Unset = UNSET + wheel: None | Unset | WheelInput = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + max_speed = self.max_speed + + step_size_speed = self.step_size_speed + + acceleration = self.acceleration + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + mass: dict[str, Any] | None | Unset + if isinstance(self.mass, Unset): + mass = UNSET + elif isinstance(self.mass, Mass): + mass = self.mass.to_dict() + else: + mass = self.mass + + aero: dict[str, Any] | None | Unset + if isinstance(self.aero, Unset): + aero = UNSET + elif isinstance(self.aero, Aero): + aero = self.aero.to_dict() + else: + aero = self.aero + + wheel: dict[str, Any] | None | Unset + if isinstance(self.wheel, Unset): + wheel = UNSET + elif isinstance(self.wheel, WheelInput): + wheel = self.wheel.to_dict() + else: + wheel = self.wheel + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "max_speed": max_speed, + "step_size_speed": step_size_speed, + "acceleration": acceleration, + "altitude": altitude, + "headwind": headwind, + "gradient": gradient, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + d = dict(src_dict) + max_speed = d.pop("max_speed") + + step_size_speed = d.pop("step_size_speed") + + acceleration = d.pop("acceleration") + + altitude = d.pop("altitude") + + headwind = d.pop("headwind") + + gradient = d.pop("gradient") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + def _parse_mass(data: object) -> Mass | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + mass_type_0 = Mass.from_dict(data) + + return mass_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Mass | None | Unset, data) + + mass = _parse_mass(d.pop("mass", UNSET)) + + def _parse_aero(data: object) -> Aero | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + aero_type_0 = Aero.from_dict(data) + + return aero_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Aero | None | Unset, data) + + aero = _parse_aero(d.pop("aero", UNSET)) + + def _parse_wheel(data: object) -> None | Unset | WheelInput: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + wheel_type_0 = WheelInput.from_dict(data) + + return wheel_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelInput, data) + + wheel = _parse_wheel(d.pop("wheel", UNSET)) + + total_tractive_torque_graph_input = cls( + max_speed=max_speed, + step_size_speed=step_size_speed, + acceleration=acceleration, + altitude=altitude, + headwind=headwind, + gradient=gradient, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + mass=mass, + aero=aero, + wheel=wheel, + ) + + total_tractive_torque_graph_input.additional_properties = d + return total_tractive_torque_graph_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_output.py b/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_output.py new file mode 100644 index 00000000..8ec4b1ee --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/total_tractive_torque_graph_output.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TotalTractiveTorqueGraphOutput") + + +@_attrs_define +class TotalTractiveTorqueGraphOutput: + """Total Tractive Torque Graph Output.""" + + speeds: list[float] + acceleration: float + total_tractive_torques: list[float] + aero_forces: list[float] + mass_forces: list[float] + total_forces: list[float] + total_tractive_powers: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + speeds = self.speeds + + acceleration = self.acceleration + + total_tractive_torques = self.total_tractive_torques + + aero_forces = self.aero_forces + + mass_forces = self.mass_forces + + total_forces = self.total_forces + + total_tractive_powers = self.total_tractive_powers + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "speeds": speeds, + "acceleration": acceleration, + "total_tractive_torques": total_tractive_torques, + "aero_forces": aero_forces, + "mass_forces": mass_forces, + "total_forces": total_forces, + "total_tractive_powers": total_tractive_powers, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + speeds = cast(list[float], d.pop("speeds")) + + acceleration = d.pop("acceleration") + + total_tractive_torques = cast(list[float], d.pop("total_tractive_torques")) + + aero_forces = cast(list[float], d.pop("aero_forces")) + + mass_forces = cast(list[float], d.pop("mass_forces")) + + total_forces = cast(list[float], d.pop("total_forces")) + + total_tractive_powers = cast(list[float], d.pop("total_tractive_powers")) + + total_tractive_torque_graph_output = cls( + speeds=speeds, + acceleration=acceleration, + total_tractive_torques=total_tractive_torques, + aero_forces=aero_forces, + mass_forces=mass_forces, + total_forces=total_forces, + total_tractive_powers=total_tractive_powers, + ) + + total_tractive_torque_graph_output.additional_properties = d + return total_tractive_torque_graph_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_input.py b/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_input.py new file mode 100644 index 00000000..772a06fc --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_input.py @@ -0,0 +1,190 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TransmissionLossCoefficientsInput") + + +@_attrs_define +class TransmissionLossCoefficientsInput: + """Transmission Loss Coefficients Input.""" + + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Loss Coefficients Transmission" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["TransmissionLossCoefficients"] | Unset = "TransmissionLossCoefficients" + gear_ratios: list[float] | Unset = UNSET + headline_efficiencies: list[float] | Unset = UNSET + max_torque: float | Unset = 200.0 + max_speed: float | Unset = 1047.1975499999983 + static_drags: list[float] | Unset = UNSET + friction_ratios: list[float] | Unset = UNSET + shift_time: float | Unset = 0.0 + moment_of_inertia_wheel_side: float | Unset = 0.0 + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + gear_ratios: list[float] | Unset = UNSET + if not isinstance(self.gear_ratios, Unset): + gear_ratios = self.gear_ratios + + headline_efficiencies: list[float] | Unset = UNSET + if not isinstance(self.headline_efficiencies, Unset): + headline_efficiencies = self.headline_efficiencies + + max_torque = self.max_torque + + max_speed = self.max_speed + + static_drags: list[float] | Unset = UNSET + if not isinstance(self.static_drags, Unset): + static_drags = self.static_drags + + friction_ratios: list[float] | Unset = UNSET + if not isinstance(self.friction_ratios, Unset): + friction_ratios = self.friction_ratios + + shift_time = self.shift_time + + moment_of_inertia_wheel_side = self.moment_of_inertia_wheel_side + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if gear_ratios is not UNSET: + field_dict["gear_ratios"] = gear_ratios + if headline_efficiencies is not UNSET: + field_dict["headline_efficiencies"] = headline_efficiencies + if max_torque is not UNSET: + field_dict["max_torque"] = max_torque + if max_speed is not UNSET: + field_dict["max_speed"] = max_speed + if static_drags is not UNSET: + field_dict["static_drags"] = static_drags + if friction_ratios is not UNSET: + field_dict["friction_ratios"] = friction_ratios + if shift_time is not UNSET: + field_dict["shift_time"] = shift_time + if moment_of_inertia_wheel_side is not UNSET: + field_dict["moment_of_inertia_wheel_side"] = moment_of_inertia_wheel_side + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["TransmissionLossCoefficients"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "TransmissionLossCoefficients" and not isinstance( + component_type, Unset + ): + raise ValueError( + f"component_type must match const 'TransmissionLossCoefficients', got '{component_type}'" + ) + + gear_ratios = cast(list[float], d.pop("gear_ratios", UNSET)) + + headline_efficiencies = cast(list[float], d.pop("headline_efficiencies", UNSET)) + + max_torque = d.pop("max_torque", UNSET) + + max_speed = d.pop("max_speed", UNSET) + + static_drags = cast(list[float], d.pop("static_drags", UNSET)) + + friction_ratios = cast(list[float], d.pop("friction_ratios", UNSET)) + + shift_time = d.pop("shift_time", UNSET) + + moment_of_inertia_wheel_side = d.pop("moment_of_inertia_wheel_side", UNSET) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + transmission_loss_coefficients_input = cls( + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + gear_ratios=gear_ratios, + headline_efficiencies=headline_efficiencies, + max_torque=max_torque, + max_speed=max_speed, + static_drags=static_drags, + friction_ratios=friction_ratios, + shift_time=shift_time, + moment_of_inertia_wheel_side=moment_of_inertia_wheel_side, + part_type=part_type, + ) + + transmission_loss_coefficients_input.additional_properties = d + return transmission_loss_coefficients_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_output.py b/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_output.py new file mode 100644 index 00000000..59541f8f --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/transmission_loss_coefficients_output.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TransmissionLossCoefficientsOutput") + + +@_attrs_define +class TransmissionLossCoefficientsOutput: + """Transmission Loss Coefficients Output.""" + + id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Loss Coefficients Transmission" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["TransmissionLossCoefficients"] | Unset = "TransmissionLossCoefficients" + gear_ratios: list[float] | Unset = UNSET + headline_efficiencies: list[float] | Unset = UNSET + max_torque: float | Unset = 200.0 + max_speed: float | Unset = 1047.1975499999983 + static_drags: list[float] | Unset = UNSET + friction_ratios: list[float] | Unset = UNSET + shift_time: float | Unset = 0.0 + moment_of_inertia_wheel_side: float | Unset = 0.0 + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + gear_ratios: list[float] | Unset = UNSET + if not isinstance(self.gear_ratios, Unset): + gear_ratios = self.gear_ratios + + headline_efficiencies: list[float] | Unset = UNSET + if not isinstance(self.headline_efficiencies, Unset): + headline_efficiencies = self.headline_efficiencies + + max_torque = self.max_torque + + max_speed = self.max_speed + + static_drags: list[float] | Unset = UNSET + if not isinstance(self.static_drags, Unset): + static_drags = self.static_drags + + friction_ratios: list[float] | Unset = UNSET + if not isinstance(self.friction_ratios, Unset): + friction_ratios = self.friction_ratios + + shift_time = self.shift_time + + moment_of_inertia_wheel_side = self.moment_of_inertia_wheel_side + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if gear_ratios is not UNSET: + field_dict["gear_ratios"] = gear_ratios + if headline_efficiencies is not UNSET: + field_dict["headline_efficiencies"] = headline_efficiencies + if max_torque is not UNSET: + field_dict["max_torque"] = max_torque + if max_speed is not UNSET: + field_dict["max_speed"] = max_speed + if static_drags is not UNSET: + field_dict["static_drags"] = static_drags + if friction_ratios is not UNSET: + field_dict["friction_ratios"] = friction_ratios + if shift_time is not UNSET: + field_dict["shift_time"] = shift_time + if moment_of_inertia_wheel_side is not UNSET: + field_dict["moment_of_inertia_wheel_side"] = moment_of_inertia_wheel_side + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["TransmissionLossCoefficients"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "TransmissionLossCoefficients" and not isinstance( + component_type, Unset + ): + raise ValueError( + f"component_type must match const 'TransmissionLossCoefficients', got '{component_type}'" + ) + + gear_ratios = cast(list[float], d.pop("gear_ratios", UNSET)) + + headline_efficiencies = cast(list[float], d.pop("headline_efficiencies", UNSET)) + + max_torque = d.pop("max_torque", UNSET) + + max_speed = d.pop("max_speed", UNSET) + + static_drags = cast(list[float], d.pop("static_drags", UNSET)) + + friction_ratios = cast(list[float], d.pop("friction_ratios", UNSET)) + + shift_time = d.pop("shift_time", UNSET) + + moment_of_inertia_wheel_side = d.pop("moment_of_inertia_wheel_side", UNSET) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + transmission_loss_coefficients_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + gear_ratios=gear_ratios, + headline_efficiencies=headline_efficiencies, + max_torque=max_torque, + max_speed=max_speed, + static_drags=static_drags, + friction_ratios=friction_ratios, + shift_time=shift_time, + moment_of_inertia_wheel_side=moment_of_inertia_wheel_side, + part_type=part_type, + ) + + transmission_loss_coefficients_output.additional_properties = d + return transmission_loss_coefficients_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/unit_choices.py b/schema/generated_client/conceptev_api_client/models/unit_choices.py new file mode 100644 index 00000000..3cbb7efb --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/unit_choices.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap + + +T = TypeVar("T", bound="UnitChoices") + + +@_attrs_define +class UnitChoices: + """Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + """ + + unit_type_to_unit_map: UnitChoicesUnitTypeToUnitMap | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + unit_type_to_unit_map: dict[str, Any] | Unset = UNSET + if not isinstance(self.unit_type_to_unit_map, Unset): + unit_type_to_unit_map = self.unit_type_to_unit_map.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if unit_type_to_unit_map is not UNSET: + field_dict["unit_type_to_unit_map"] = unit_type_to_unit_map + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap + + d = dict(src_dict) + _unit_type_to_unit_map = d.pop("unit_type_to_unit_map", UNSET) + unit_type_to_unit_map: UnitChoicesUnitTypeToUnitMap | Unset + if isinstance(_unit_type_to_unit_map, Unset): + unit_type_to_unit_map = UNSET + else: + unit_type_to_unit_map = UnitChoicesUnitTypeToUnitMap.from_dict(_unit_type_to_unit_map) + + unit_choices = cls( + unit_type_to_unit_map=unit_type_to_unit_map, + ) + + unit_choices.additional_properties = d + return unit_choices + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/unit_choices_unit_type_to_unit_map.py b/schema/generated_client/conceptev_api_client/models/unit_choices_unit_type_to_unit_map.py new file mode 100644 index 00000000..52413fff --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/unit_choices_unit_type_to_unit_map.py @@ -0,0 +1,491 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.acceleration_unit import AccelerationUnit, check_acceleration_unit +from ..models.angle_unit import AngleUnit, check_angle_unit +from ..models.angular_acceleration_unit import ( + AngularAccelerationUnit, + check_angular_acceleration_unit, +) +from ..models.angular_speed_unit import AngularSpeedUnit, check_angular_speed_unit +from ..models.area_unit import AreaUnit, check_area_unit +from ..models.current_unit import CurrentUnit, check_current_unit +from ..models.density_unit import DensityUnit, check_density_unit +from ..models.electric_charge_unit import ElectricChargeUnit, check_electric_charge_unit +from ..models.electrical_energy_unit import ElectricalEnergyUnit, check_electrical_energy_unit +from ..models.electrical_power_unit import ElectricalPowerUnit, check_electrical_power_unit +from ..models.energy_unit import EnergyUnit, check_energy_unit +from ..models.force_unit import ForceUnit, check_force_unit +from ..models.frequency_unit import FrequencyUnit, check_frequency_unit +from ..models.inertia_unit import InertiaUnit, check_inertia_unit +from ..models.length_unit import LengthUnit, check_length_unit +from ..models.mass_unit import MassUnit, check_mass_unit +from ..models.power_unit import PowerUnit, check_power_unit +from ..models.pressure_unit import PressureUnit, check_pressure_unit +from ..models.ratio_unit import RatioUnit, check_ratio_unit +from ..models.resistance_unit import ResistanceUnit, check_resistance_unit +from ..models.road_efficiency_unit import RoadEfficiencyUnit, check_road_efficiency_unit +from ..models.speed_unit import SpeedUnit, check_speed_unit +from ..models.temperature_unit import TemperatureUnit, check_temperature_unit +from ..models.time_unit import TimeUnit, check_time_unit +from ..models.torque_unit import TorqueUnit, check_torque_unit +from ..models.voltage_unit import VoltageUnit, check_voltage_unit +from ..models.volume_unit import VolumeUnit, check_volume_unit +from ..models.volumetric_flow_rate_unit import ( + VolumetricFlowRateUnit, + check_volumetric_flow_rate_unit, +) + +T = TypeVar("T", bound="UnitChoicesUnitTypeToUnitMap") + + +@_attrs_define +class UnitChoicesUnitTypeToUnitMap: + additional_properties: dict[ + str, + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit, + ] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + if isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + else: + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + unit_choices_unit_type_to_unit_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property( + data: object, + ) -> ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ): + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_0 = check_mass_unit(data) + + return additional_property_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_1 = check_time_unit(data) + + return additional_property_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_2 = check_force_unit(data) + + return additional_property_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_3 = check_torque_unit(data) + + return additional_property_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_4 = check_temperature_unit(data) + + return additional_property_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_5 = check_length_unit(data) + + return additional_property_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_6 = check_area_unit(data) + + return additional_property_type_6 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_7 = check_volume_unit(data) + + return additional_property_type_7 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_8 = check_speed_unit(data) + + return additional_property_type_8 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_9 = check_acceleration_unit(data) + + return additional_property_type_9 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_10 = check_angular_speed_unit(data) + + return additional_property_type_10 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_11 = check_angular_acceleration_unit(data) + + return additional_property_type_11 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_12 = check_energy_unit(data) + + return additional_property_type_12 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_13 = check_power_unit(data) + + return additional_property_type_13 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_14 = check_density_unit(data) + + return additional_property_type_14 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_15 = check_inertia_unit(data) + + return additional_property_type_15 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_16 = check_pressure_unit(data) + + return additional_property_type_16 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_17 = check_ratio_unit(data) + + return additional_property_type_17 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_18 = check_voltage_unit(data) + + return additional_property_type_18 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_19 = check_current_unit(data) + + return additional_property_type_19 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_20 = check_resistance_unit(data) + + return additional_property_type_20 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_21 = check_electric_charge_unit(data) + + return additional_property_type_21 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_22 = check_electrical_energy_unit(data) + + return additional_property_type_22 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_23 = check_electrical_power_unit(data) + + return additional_property_type_23 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_24 = check_angle_unit(data) + + return additional_property_type_24 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_25 = check_road_efficiency_unit(data) + + return additional_property_type_25 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_26 = check_frequency_unit(data) + + return additional_property_type_26 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, str): + raise TypeError() + additional_property_type_27 = check_volumetric_flow_rate_unit(data) + + return additional_property_type_27 + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + unit_choices_unit_type_to_unit_map.additional_properties = additional_properties + return unit_choices_unit_type_to_unit_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__( + self, key: str + ) -> ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ): + return self.additional_properties[key] + + def __setitem__( + self, + key: str, + value: ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ), + ) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/validation_error.py b/schema/generated_client/conceptev_api_client/models/validation_error.py new file mode 100644 index 00000000..2eeff936 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/validation_error.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error_context import ValidationErrorContext + + +T = TypeVar("T", bound="ValidationError") + + +@_attrs_define +class ValidationError: + loc: list[int | str] + msg: str + type_: str + input_: Any | Unset = UNSET + ctx: ValidationErrorContext | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + loc = [] + for loc_item_data in self.loc: + loc_item: int | str + loc_item = loc_item_data + loc.append(loc_item) + + msg = self.msg + + type_ = self.type_ + + input_ = self.input_ + + ctx: dict[str, Any] | Unset = UNSET + if not isinstance(self.ctx, Unset): + ctx = self.ctx.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "loc": loc, + "msg": msg, + "type": type_, + } + ) + if input_ is not UNSET: + field_dict["input"] = input_ + if ctx is not UNSET: + field_dict["ctx"] = ctx + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error_context import ValidationErrorContext + + d = dict(src_dict) + loc = [] + _loc = d.pop("loc") + for loc_item_data in _loc: + + def _parse_loc_item(data: object) -> int | str: + return cast(int | str, data) + + loc_item = _parse_loc_item(loc_item_data) + + loc.append(loc_item) + + msg = d.pop("msg") + + type_ = d.pop("type") + + input_ = d.pop("input", UNSET) + + _ctx = d.pop("ctx", UNSET) + ctx: ValidationErrorContext | Unset + if isinstance(_ctx, Unset): + ctx = UNSET + else: + ctx = ValidationErrorContext.from_dict(_ctx) + + validation_error = cls( + loc=loc, + msg=msg, + type_=type_, + input_=input_, + ctx=ctx, + ) + + validation_error.additional_properties = d + return validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/validation_error_context.py b/schema/generated_client/conceptev_api_client/models/validation_error_context.py new file mode 100644 index 00000000..124b115a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/validation_error_context.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidationErrorContext") + + +@_attrs_define +class ValidationErrorContext: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + validation_error_context = cls() + + validation_error_context.additional_properties = d + return validation_error_context + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/voltage_unit.py b/schema/generated_client/conceptev_api_client/models/voltage_unit.py new file mode 100644 index 00000000..db912d1a --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/voltage_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +VoltageUnit = Literal["kV", "mV", "V"] + +VOLTAGE_UNIT_VALUES: set[VoltageUnit] = { + "kV", + "mV", + "V", +} + + +def check_voltage_unit(value: str) -> VoltageUnit: + if value in VOLTAGE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {VOLTAGE_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/volume_unit.py b/schema/generated_client/conceptev_api_client/models/volume_unit.py new file mode 100644 index 00000000..0d98490b --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/volume_unit.py @@ -0,0 +1,21 @@ +from typing import Literal + +VolumeUnit = Literal["cc", "cm³", "ft³", "in³", "l", "ml", "mm³", "m³", "yd³"] + +VOLUME_UNIT_VALUES: set[VolumeUnit] = { + "cc", + "cm³", + "ft³", + "in³", + "l", + "ml", + "mm³", + "m³", + "yd³", +} + + +def check_volume_unit(value: str) -> VolumeUnit: + if value in VOLUME_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {VOLUME_UNIT_VALUES!r}") diff --git a/schema/generated_client/conceptev_api_client/models/volumetric_flow_rate_unit.py b/schema/generated_client/conceptev_api_client/models/volumetric_flow_rate_unit.py new file mode 100644 index 00000000..71cf19b6 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/volumetric_flow_rate_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +VolumetricFlowRateUnit = Literal["l/min", "l/s", "m³/min", "m³/s"] + +VOLUMETRIC_FLOW_RATE_UNIT_VALUES: set[VolumetricFlowRateUnit] = { + "l/min", + "l/s", + "m³/min", + "m³/s", +} + + +def check_volumetric_flow_rate_unit(value: str) -> VolumetricFlowRateUnit: + if value in VOLUMETRIC_FLOW_RATE_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {VOLUMETRIC_FLOW_RATE_UNIT_VALUES!r}" + ) diff --git a/schema/generated_client/conceptev_api_client/models/wheel_input.py b/schema/generated_client/conceptev_api_client/models/wheel_input.py new file mode 100644 index 00000000..becb3f7c --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/wheel_input.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.surface_condition_traction_configs import ( + SurfaceConditionTractionConfigs, + check_surface_condition_traction_configs, +) +from ..models.wheel_rolling_resistance_configs import ( + WheelRollingResistanceConfigs, + check_wheel_rolling_resistance_configs, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WheelInput") + + +@_attrs_define +class WheelInput: + """Wheel Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Wheel" + mass: float | Unset = 0.0 + cost: float | Unset = 0.0 + rolling_radius: float | Unset = 0.3 + rolling_resistance_coefficient: float | Unset = 0.02 + rolling_resistance_key: None | Unset | WheelRollingResistanceConfigs = UNSET + traction_coefficient: float | Unset = 0.9 + traction_coefficient_key: None | SurfaceConditionTractionConfigs | Unset = UNSET + config_type: Literal["wheel"] | Unset = "wheel" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + cost = self.cost + + rolling_radius = self.rolling_radius + + rolling_resistance_coefficient = self.rolling_resistance_coefficient + + rolling_resistance_key: None | str | Unset + if isinstance(self.rolling_resistance_key, Unset): + rolling_resistance_key = UNSET + elif isinstance(self.rolling_resistance_key, str): + rolling_resistance_key = self.rolling_resistance_key + else: + rolling_resistance_key = self.rolling_resistance_key + + traction_coefficient = self.traction_coefficient + + traction_coefficient_key: None | str | Unset + if isinstance(self.traction_coefficient_key, Unset): + traction_coefficient_key = UNSET + elif isinstance(self.traction_coefficient_key, str): + traction_coefficient_key = self.traction_coefficient_key + else: + traction_coefficient_key = self.traction_coefficient_key + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if cost is not UNSET: + field_dict["cost"] = cost + if rolling_radius is not UNSET: + field_dict["rolling_radius"] = rolling_radius + if rolling_resistance_coefficient is not UNSET: + field_dict["rolling_resistance_coefficient"] = rolling_resistance_coefficient + if rolling_resistance_key is not UNSET: + field_dict["rolling_resistance_key"] = rolling_resistance_key + if traction_coefficient is not UNSET: + field_dict["traction_coefficient"] = traction_coefficient + if traction_coefficient_key is not UNSET: + field_dict["traction_coefficient_key"] = traction_coefficient_key + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + cost = d.pop("cost", UNSET) + + rolling_radius = d.pop("rolling_radius", UNSET) + + rolling_resistance_coefficient = d.pop("rolling_resistance_coefficient", UNSET) + + def _parse_rolling_resistance_key( + data: object, + ) -> None | Unset | WheelRollingResistanceConfigs: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + rolling_resistance_key_type_0 = check_wheel_rolling_resistance_configs(data) + + return rolling_resistance_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelRollingResistanceConfigs, data) + + rolling_resistance_key = _parse_rolling_resistance_key( + d.pop("rolling_resistance_key", UNSET) + ) + + traction_coefficient = d.pop("traction_coefficient", UNSET) + + def _parse_traction_coefficient_key( + data: object, + ) -> None | SurfaceConditionTractionConfigs | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + traction_coefficient_key_type_0 = check_surface_condition_traction_configs(data) + + return traction_coefficient_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SurfaceConditionTractionConfigs | Unset, data) + + traction_coefficient_key = _parse_traction_coefficient_key( + d.pop("traction_coefficient_key", UNSET) + ) + + config_type = cast(Literal["wheel"] | Unset, d.pop("config_type", UNSET)) + if config_type != "wheel" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'wheel', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + wheel_input = cls( + item_type=item_type, + name=name, + mass=mass, + cost=cost, + rolling_radius=rolling_radius, + rolling_resistance_coefficient=rolling_resistance_coefficient, + rolling_resistance_key=rolling_resistance_key, + traction_coefficient=traction_coefficient, + traction_coefficient_key=traction_coefficient_key, + config_type=config_type, + part_type=part_type, + ) + + wheel_input.additional_properties = d + return wheel_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/wheel_output.py b/schema/generated_client/conceptev_api_client/models/wheel_output.py new file mode 100644 index 00000000..dcd52cd1 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/wheel_output.py @@ -0,0 +1,212 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.surface_condition_traction_configs import ( + SurfaceConditionTractionConfigs, + check_surface_condition_traction_configs, +) +from ..models.wheel_rolling_resistance_configs import ( + WheelRollingResistanceConfigs, + check_wheel_rolling_resistance_configs, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WheelOutput") + + +@_attrs_define +class WheelOutput: + """Wheel Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Wheel" + mass: float | Unset = 0.0 + cost: float | Unset = 0.0 + rolling_radius: float | Unset = 0.3 + rolling_resistance_coefficient: float | Unset = 0.02 + rolling_resistance_key: None | Unset | WheelRollingResistanceConfigs = UNSET + traction_coefficient: float | Unset = 0.9 + traction_coefficient_key: None | SurfaceConditionTractionConfigs | Unset = UNSET + config_type: Literal["wheel"] | Unset = "wheel" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + cost = self.cost + + rolling_radius = self.rolling_radius + + rolling_resistance_coefficient = self.rolling_resistance_coefficient + + rolling_resistance_key: None | str | Unset + if isinstance(self.rolling_resistance_key, Unset): + rolling_resistance_key = UNSET + elif isinstance(self.rolling_resistance_key, str): + rolling_resistance_key = self.rolling_resistance_key + else: + rolling_resistance_key = self.rolling_resistance_key + + traction_coefficient = self.traction_coefficient + + traction_coefficient_key: None | str | Unset + if isinstance(self.traction_coefficient_key, Unset): + traction_coefficient_key = UNSET + elif isinstance(self.traction_coefficient_key, str): + traction_coefficient_key = self.traction_coefficient_key + else: + traction_coefficient_key = self.traction_coefficient_key + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if cost is not UNSET: + field_dict["cost"] = cost + if rolling_radius is not UNSET: + field_dict["rolling_radius"] = rolling_radius + if rolling_resistance_coefficient is not UNSET: + field_dict["rolling_resistance_coefficient"] = rolling_resistance_coefficient + if rolling_resistance_key is not UNSET: + field_dict["rolling_resistance_key"] = rolling_resistance_key + if traction_coefficient is not UNSET: + field_dict["traction_coefficient"] = traction_coefficient + if traction_coefficient_key is not UNSET: + field_dict["traction_coefficient_key"] = traction_coefficient_key + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + cost = d.pop("cost", UNSET) + + rolling_radius = d.pop("rolling_radius", UNSET) + + rolling_resistance_coefficient = d.pop("rolling_resistance_coefficient", UNSET) + + def _parse_rolling_resistance_key( + data: object, + ) -> None | Unset | WheelRollingResistanceConfigs: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + rolling_resistance_key_type_0 = check_wheel_rolling_resistance_configs(data) + + return rolling_resistance_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelRollingResistanceConfigs, data) + + rolling_resistance_key = _parse_rolling_resistance_key( + d.pop("rolling_resistance_key", UNSET) + ) + + traction_coefficient = d.pop("traction_coefficient", UNSET) + + def _parse_traction_coefficient_key( + data: object, + ) -> None | SurfaceConditionTractionConfigs | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + traction_coefficient_key_type_0 = check_surface_condition_traction_configs(data) + + return traction_coefficient_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SurfaceConditionTractionConfigs | Unset, data) + + traction_coefficient_key = _parse_traction_coefficient_key( + d.pop("traction_coefficient_key", UNSET) + ) + + config_type = cast(Literal["wheel"] | Unset, d.pop("config_type", UNSET)) + if config_type != "wheel" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'wheel', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + wheel_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + cost=cost, + rolling_radius=rolling_radius, + rolling_resistance_coefficient=rolling_resistance_coefficient, + rolling_resistance_key=rolling_resistance_key, + traction_coefficient=traction_coefficient, + traction_coefficient_key=traction_coefficient_key, + config_type=config_type, + part_type=part_type, + ) + + wheel_output.additional_properties = d + return wheel_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/schema/generated_client/conceptev_api_client/models/wheel_rolling_resistance_configs.py b/schema/generated_client/conceptev_api_client/models/wheel_rolling_resistance_configs.py new file mode 100644 index 00000000..94b3d457 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/models/wheel_rolling_resistance_configs.py @@ -0,0 +1,17 @@ +from typing import Literal + +WheelRollingResistanceConfigs = Literal["Car on asphalt", "Car on concrete", "Car on gravel"] + +WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES: set[WheelRollingResistanceConfigs] = { + "Car on asphalt", + "Car on concrete", + "Car on gravel", +} + + +def check_wheel_rolling_resistance_configs(value: str) -> WheelRollingResistanceConfigs: + if value in WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES!r}" + ) diff --git a/schema/generated_client/conceptev_api_client/py.typed b/schema/generated_client/conceptev_api_client/py.typed new file mode 100644 index 00000000..1aad3271 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/schema/generated_client/conceptev_api_client/types.py b/schema/generated_client/conceptev_api_client/types.py new file mode 100644 index 00000000..b64af095 --- /dev/null +++ b/schema/generated_client/conceptev_api_client/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/schema/generated_client/pyproject.toml b/schema/generated_client/pyproject.toml new file mode 100644 index 00000000..a16dbb8b --- /dev/null +++ b/schema/generated_client/pyproject.toml @@ -0,0 +1,25 @@ +[tool.poetry] +name = "conceptev-api-client" +version = "0.2.158" +description = "A client library for accessing ConceptEV-API" +authors = [] +readme = "README.md" +packages = [ + { include = "conceptev_api_client" }, +] +include = ["conceptev_api_client/py.typed"] + +[tool.poetry.dependencies] +python = "^3.11" +httpx = ">=0.23.1,<0.29.0" +attrs = ">=22.2.0" + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = ["F", "I", "UP"] diff --git a/schema/opc_config.yaml b/schema/opc_config.yaml new file mode 100644 index 00000000..88b19573 --- /dev/null +++ b/schema/opc_config.yaml @@ -0,0 +1,20 @@ +# openapi-python-client configuration +# https://github.com/openapi-generators/openapi-python-client#configuration + +# Override the generated project/package name instead of deriving it from the +# spec title ("ConceptEV-API" → "concept-ev-api-client" by default). +project_name_override: conceptev-api-client +package_name_override: conceptev_api_client + +# Put attribute descriptions in per-attribute docstrings rather than bundling +# them all in the class-level docstring — cleaner for IDE tooling. +docstrings_on_attributes: true + +# Use Literal values instead of Enum subclasses. Required because the spec has +# duplicate case-folded enum keys (e.g. "MJ" / "mJ" in EnergyUnit). +literal_enums: true + +# Post-generation hooks — default ruff lint + format passes. +post_hooks: + - "ruff check . --fix-only" + - "ruff format ." diff --git a/schema/openapi.json b/schema/openapi.json new file mode 100644 index 00000000..c848b25b --- /dev/null +++ b/schema/openapi.json @@ -0,0 +1,14864 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "ConceptEV-API", + "summary": "API Endpoint documentation for ConceptEV", + "version": "0.2.161" + }, + "paths": { + "/concepts": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Create Concept Check", + "description": "Create with additional checks.", + "operationId": "create_concept_check_concepts_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Concepts" + ], + "summary": "Read By Design Or Design Instance Ids", + "description": "Get from ID.", + "operationId": "read_by_design_or_design_instance_ids_concepts_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{design_identifier}/settings": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Create Or Update Design Instance Settings", + "description": "Create or update Concept settings.", + "operationId": "create_or_update_design_instance_settings_concepts__design_identifier__settings_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Concepts" + ], + "summary": "Get Design Instance Settings", + "description": "Retrieve Concept settings, falling back to defaults if missing or incomplete.", + "operationId": "get_design_instance_settings_concepts__design_identifier__settings_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Concepts" + ], + "summary": "Delete Design Instance Settings", + "description": "Delete Concept settings.", + "operationId": "delete_design_instance_settings_concepts__design_identifier__settings_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{design_identifier}/{part_name}": { + "get": { + "tags": [ + "Concepts" + ], + "summary": "List Parts", + "description": "Get the parts of a concept.", + "operationId": "list_parts_concepts__design_identifier___part_name__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "part_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartNames" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "$ref": "#/components/schemas/ComponentInDB" + }, + { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + { + "$ref": "#/components/schemas/Requirement" + }, + { + "$ref": "#/components/schemas/DriveCycleInDB" + } + ] + } + }, + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "$ref": "#/components/schemas/ComponentInDB" + }, + { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + { + "$ref": "#/components/schemas/Requirement" + }, + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "type": "null" + } + ], + "title": "Response List Parts Concepts Design Identifier Part Name Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{item_id}": { + "patch": { + "tags": [ + "Concepts" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_concepts__item_id__patch", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Concepts" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_concepts__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:copy": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Copy", + "description": "Clone Concept.", + "operationId": "copy_concepts_copy_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "populated", + "in": "query", + "required": true, + "schema": { + "type": "boolean", + "title": "Populated" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptCloneInput" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConceptPopulated" + }, + { + "$ref": "#/components/schemas/Concept" + } + ], + "discriminator": { + "propertyName": "concept_type", + "mapping": { + "populated": "#/components/schemas/ConceptPopulated", + "not populated": "#/components/schemas/Concept" + } + }, + "title": "Response Copy Concepts Copy Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:export": { + "get": { + "tags": [ + "Concepts" + ], + "summary": "Export Concept", + "description": "Export Concept to Exchange File.", + "operationId": "export_concept_concepts_export_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "get_jobs", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": false, + "title": "Get Jobs" + } + }, + { + "name": "get_s3_files", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Get S3 Files" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeFile" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:import": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Import Concept", + "description": "Import Concept from Exchange File.", + "operationId": "import_concept_concepts_import_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Design Id" + } + }, + { + "name": "project_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Project Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_import_concept_concepts_import_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations": { + "post": { + "tags": [ + "Configurations" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_configurations_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + }, + "title": "Configuration" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations/{item_id}": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_configurations__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Configurations" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_configurations__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + }, + "title": "Configuration" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Configurations" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_configurations__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations:calculate_forces": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Calculate Total Forces", + "description": "Calculate the total tractive torque.", + "operationId": "calculate_total_forces_configurations_calculate_forces_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "aero_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Aero Id" + } + }, + { + "name": "mass_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Mass Id" + } + }, + { + "name": "wheel_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Wheel Id" + } + }, + { + "name": "max_speed", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 40, + "title": "Max Speed" + } + }, + { + "name": "acceleration", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Acceleration" + } + }, + { + "name": "altitude", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Altitude" + } + }, + { + "name": "headwind", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Headwind" + } + }, + { + "name": "gradient", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Gradient" + } + }, + { + "name": "step_size_speed", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0.2, + "title": "Step Size Speed" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraph" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_components_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "title": "Component" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:upload_file": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create Component Data From File", + "description": "Create component part from uploaded file.", + "operationId": "create_component_data_from_file_components_upload_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "file_parameters", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileParameters" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_component_data_from_file_components_upload_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:upload": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create File Items", + "description": "Create component from uploaded file.\n\nReturns the created file item ID and any extracted data needed by the UI in a dict.", + "operationId": "create_file_items_components_upload_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_file_type", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ComponentFileType" + } + }, + { + "name": "return_speed_only", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Return Speed Only" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_file_items_components_upload_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "anyOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "number" + } + ] + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Create File Items Components Upload Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:thermal_model": { + "post": { + "tags": [ + "Components" + ], + "summary": "Add Thermal Model", + "description": "Add a thermal model to an existing file item e.g. MotorLabDataInDB.\n\nCurrently only works for legacy components with data in DB, need to implement for\nS3 as well.", + "operationId": "add_thermal_model_components_thermal_model_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_add_thermal_model_components_thermal_model_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThermalModelDetails" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components/{item_id}": { + "get": { + "tags": [ + "Components" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_components__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Components" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_components__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + }, + "title": "Component" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Components" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_components__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:get_display_data": { + "post": { + "tags": [ + "Components" + ], + "summary": "Calc Display Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_display_data_components_get_display_data_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Component Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:image_data": { + "post": { + "tags": [ + "Components" + ], + "summary": "Calc Image Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_image_data_components_image_data_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Component Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures": { + "post": { + "tags": [ + "Architectures" + ], + "summary": "Create Architectures", + "description": "Create architecture from different inputs types.", + "operationId": "create_architectures_architectures_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures/{item_id}": { + "get": { + "tags": [ + "Architectures" + ], + "summary": "Read Architecture", + "description": "Get Architecture from ID.", + "operationId": "read_architecture_architectures__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Architectures" + ], + "summary": "Update Architecture", + "description": "Update Architecture with new Architecture.", + "operationId": "update_architecture_architectures__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Architectures" + ], + "summary": "Delete Architecture", + "description": "Delete architecture by ID.", + "operationId": "delete_architecture_architectures__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures:max_speed": { + "get": { + "tags": [ + "Architectures" + ], + "summary": "Get Architecture Max Speed", + "description": "Get the max linear speed of the architecture from component bounds.", + "operationId": "get_architecture_max_speed_architectures_max_speed_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "wheel_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Wheel Id" + } + }, + { + "name": "architecture_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Architecture Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "number", + "title": "Response Get Architecture Max Speed Architectures Max Speed Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_drive_cycles_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "title": "Drive Cycle" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "$ref": "#/components/schemas/DriveCycleS3InDB" + } + ], + "title": "Response Create Drive Cycles Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles/{item_id}": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_drive_cycles__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Response Read Drive Cycles Item Id Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Drive Cycles" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_drive_cycles__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Drive Cycle" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Drive Cycles" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_drive_cycles__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:names": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "List Drive Cycle Names", + "description": "Get a dict of drive cycle names by ID.", + "operationId": "list_drive_cycle_names_drive_cycles_names_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response List Drive Cycle Names Drive Cycles Names Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:data": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "List Drive Cycle Data", + "description": "Get a list of drive cycle data dicts.", + "operationId": "list_drive_cycle_data_drive_cycles_data_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + }, + "title": "Response List Drive Cycle Data Drive Cycles Data Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:from_file": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Create From File", + "description": "Create a requirement from file.\n\nIt can be quite difficult to add anything else to this:\nhttps://stackoverflow.com/questions/65504438/how-to-add-both-file-and-json-body-in-a-fastapi-post-request", + "operationId": "create_from_file_drive_cycles_from_file_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "drive_cycle_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Drive Cycle Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_from_file_drive_cycles_from_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:upload_file": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Upload Drive Cycle File", + "description": "Create job for a drive cycle initial processing.", + "operationId": "upload_drive_cycle_file_drive_cycles_upload_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "file_parameters", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileParameters" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_upload_drive_cycle_file_drive_cycles_upload_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:standard_drive_cycle": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Get Standard Drive Cycle", + "description": "Get pre-defined drive cycle.", + "operationId": "get_standard_drive_cycle_drive_cycles_standard_drive_cycle_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "standard_drive_cycle", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/StandardDriveCycles" + } + }, + { + "name": "hpc_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Hpc Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleS3InDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:image_data": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Calc Image Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_image_data_drive_cycles_image_data_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "drive_cycle_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycle" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/requirements": { + "post": { + "tags": [ + "Requirements" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_requirements_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/requirements/{item_id}": { + "get": { + "tags": [ + "Requirements" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_requirements__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Requirements" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_requirements__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Requirements" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_requirements__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:validate": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Validate Requirement Job", + "description": "Checks if job requirements are valid.", + "operationId": "validate_requirement_job_jobs_validate_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Create Requirement Job", + "description": "Create job for a requirement and architecture.", + "operationId": "create_requirement_job_jobs_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Job" + }, + { + "$ref": "#/components/schemas/UploadedFile" + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Create Requirement Job Jobs Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Jobs" + ], + "summary": "Delete Job Endpoint", + "description": "Delete Job from Concept.", + "operationId": "delete_job_endpoint_jobs_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:start": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Start Job", + "description": "Start a job.", + "operationId": "start_job_jobs_start_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStart" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:status": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Status", + "description": "Request status of job.", + "operationId": "request_status_jobs_status_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStatus" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:result": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Result", + "description": "Get result.", + "operationId": "request_result_jobs_result_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "results_file_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Results File Name" + } + }, + { + "name": "calculate_units", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Calculate Units" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RequirementsSolved" + }, + "title": "Response Request Result Jobs Result Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:error_file": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Console Log", + "description": "Get contents of console.log.", + "operationId": "request_console_log_jobs_error_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "string", + "title": "Response Request Console Log Jobs Error File Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:data_compatibility_conversion": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Update Results File Data Format", + "description": "Update the data format of a results file form the HPC.", + "operationId": "update_results_file_data_format_jobs_data_compatibility_conversion_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "results_file_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Results File Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadedFile" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library:from_id": { + "post": { + "tags": [ + "Library" + ], + "summary": "Add To Library", + "description": "Upload a config or component to the library from the db.", + "operationId": "add_to_library_library_from_id_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "product_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Product Id" + } + }, + { + "name": "description", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Description" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + } + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Add To Library Library From Id Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library:direct_upload": { + "post": { + "tags": [ + "Library" + ], + "summary": "Add To Library Direct", + "description": "Upload a config or component directly to the library.", + "operationId": "add_to_library_direct_library_direct_upload_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "product_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Product Id" + } + }, + { + "name": "description", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Description" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + }, + "title": "Item" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + } + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Add To Library Direct Library Direct Upload Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library/{object_id}": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get From Library", + "description": "Download item from library and convert to user units.\n\nReturn as a dictionary with the id removed. Note that the object id and blob id are\nidentical so can just download directly from the blob API.", + "operationId": "get_from_library_library__object_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response Get From Library Library Object Id Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/unit_choices": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_unit_choices_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "put": { + "tags": [ + "Unit Choices" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_unit_choices_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "post": { + "tags": [ + "Unit Choices" + ], + "summary": "Create Unit Choices", + "description": "Create.", + "operationId": "create_unit_choices_unit_choices_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "delete": { + "tags": [ + "Unit Choices" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_unit_choices_delete", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/unit_choices/info": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Get Info", + "description": "Get table of units for frontend generation.", + "operationId": "get_info_unit_choices_info_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Get Info Unit Choices Info Get" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/templates": { + "post": { + "tags": [ + "templates" + ], + "summary": "Add To Templates", + "description": "Restricted to template creators.", + "operationId": "add_to_templates_templates_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "template_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Template Name" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "templates" + ], + "summary": "Update", + "description": "Restricted to template creators.", + "operationId": "update_templates_put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "templates" + ], + "summary": "Remove From Templates", + "description": "Restricted to template creators.", + "operationId": "remove_from_templates_templates_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "template_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Template Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/templates/list": { + "get": { + "tags": [ + "templates" + ], + "summary": "List Templates", + "description": "List Templates. Get name from the design name.", + "operationId": "list_templates_templates_list_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Template" + }, + "title": "Response List Templates Templates List Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/utilities:data_format_version": { + "get": { + "tags": [ + "Utilities" + ], + "summary": "Get Data Format Version Number", + "description": "Return the latest solver data format version.", + "operationId": "get_data_format_version_number_utilities_data_format_version_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "integer", + "title": "Response Get Data Format Version Number Utilities Data Format Version Get" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/version": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Version", + "description": "API Version.", + "operationId": "version_version_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Version Version Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/stage": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Stage", + "description": "What stage of cloud services the API is using, dev/test/prod.", + "operationId": "stage_stage_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "string", + "title": "Response Stage Stage Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/health": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Health Check", + "description": "Health Check.", + "operationId": "health_check_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Health Check Health Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/readiness": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Readiness Check", + "description": "Health Check.", + "operationId": "readiness_check_readiness_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/authenticated_token": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Token", + "description": "Authenticated Token.", + "operationId": "authenticated_token_authenticated_token_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/authenticated_user": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated User", + "description": "Authenticated User.", + "operationId": "authenticated_user_authenticated_user_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/authenticated_design_identifier": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Design Identifier", + "description": "Authenticated Design Instance.", + "operationId": "authenticated_design_identifier_authenticated_design_identifier_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/authenticated_access": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Product", + "description": "Authenticated Design Instance.", + "operationId": "authenticated_product_authenticated_access_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AccelerationUnit": { + "type": "string", + "enum": [ + "m/s\u00b2", + "km/hr/s", + "mph/s" + ], + "title": "AccelerationUnit", + "description": "Acceleration Unit." + }, + "Aero": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + } + }, + "type": "object", + "title": "Aero", + "description": "Aero Configuration." + }, + "AeroInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "AeroInDB", + "description": "Aero configs with Database ID." + }, + "AncillaryLoad": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Ancillary Load" + }, + "load_stationary": { + "type": "number", + "title": "Load Stationary", + "default": 1000 + }, + "load_moving": { + "type": "number", + "title": "Load Moving", + "default": 1000 + }, + "config_type": { + "type": "string", + "const": "ancillary_load", + "title": "Config Type", + "default": "ancillary_load" + } + }, + "type": "object", + "title": "AncillaryLoad", + "description": "Ancillary Load Configuration." + }, + "AncillaryLoadInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Ancillary Load" + }, + "load_stationary": { + "type": "number", + "title": "Load Stationary", + "default": 1000 + }, + "load_moving": { + "type": "number", + "title": "Load Moving", + "default": 1000 + }, + "config_type": { + "type": "string", + "const": "ancillary_load", + "title": "Config Type", + "default": "ancillary_load" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "AncillaryLoadInDB", + "description": "Ancillary load with Database ID." + }, + "AngleUnit": { + "type": "string", + "enum": [ + "rad", + "deg", + "%" + ], + "title": "AngleUnit", + "description": "Unit of Angle." + }, + "AngularAccelerationUnit": { + "type": "string", + "enum": [ + "rad/s\u00b2", + "rpm/s", + "rps/s", + "deg/s\u00b2" + ], + "title": "AngularAccelerationUnit", + "description": "Angular Acceleration Unit." + }, + "AngularSpeedUnit": { + "type": "string", + "enum": [ + "rad/s", + "rpm", + "rps", + "deg/s" + ], + "title": "AngularSpeedUnit", + "description": "Angular Speed Unit." + }, + "ArchitectureInputIds": { + "properties": { + "_id": { + "type": "string", + "title": "Id" + }, + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "components_cost": { + "type": "number", + "title": "Components Cost", + "default": 0 + }, + "components_mass": { + "type": "number", + "title": "Components Mass", + "default": 0 + }, + "max_wheel_speed": { + "type": "number", + "title": "Max Wheel Speed", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels" + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + } + }, + "type": "object", + "required": [ + "number_of_front_wheels", + "number_of_front_motors", + "number_of_rear_wheels", + "number_of_rear_motors", + "battery_id" + ], + "title": "ArchitectureInputIds", + "description": "Base class for architecture ID classes.\n\nMutable so we can calculate component masses and costs." + }, + "ArchitectureOutline": { + "properties": { + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 0 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 0 + } + }, + "type": "object", + "title": "ArchitectureOutline", + "description": "Outline of an architecture returned in solved requirements." + }, + "AreaUnit": { + "type": "string", + "enum": [ + "m\u00b2", + "mm\u00b2", + "cm\u00b2", + "in\u00b2", + "ft\u00b2", + "yd\u00b2" + ], + "title": "AreaUnit", + "description": "Area Unit." + }, + "BatteryConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "battery", + "title": "Component Config Type", + "default": "battery" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryConfiguration", + "description": "Configuration that can change characteristics of the battery." + }, + "BatteryFixedVoltages": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryFixedVoltages", + "description": "Input Values for Fixed Voltages Battery." + }, + "BatteryFixedVoltagesInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "BatteryFixedVoltagesInDB", + "description": "Battery in Database." + }, + "BatteryLookupTable": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTable", + "description": "Input values for Battery Model from Lookup Data." + }, + "BatteryLookupTableData": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableData", + "description": "Data for a lookup table battery." + }, + "BatteryLookupTableDataInDB": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableDataInDB", + "description": "Lookup table in Database." + }, + "BatteryLookupTableID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "BatteryLookupTableID", + "title": "Component Type", + "default": "BatteryLookupTableID" + } + }, + "type": "object", + "title": "BatteryLookupTableID", + "description": "Motor Lab with the data referenced by ID." + }, + "BatteryLookupTableInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTableInDB", + "description": "Battery in Database." + }, + "BatteryState": { + "properties": { + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Temperature" + } + }, + "type": "object", + "title": "BatteryState", + "description": "Variables that define state of a battery." + }, + "Blob": { + "properties": { + "blob": { + "type": "string", + "format": "base64", + "contentMediaType": "application/octet-stream", + "title": "Blob" + }, + "job_data": { + "$ref": "#/components/schemas/JobData" + } + }, + "type": "object", + "required": [ + "blob", + "job_data" + ], + "title": "Blob", + "description": "Blob Model." + }, + "Body_add_thermal_model_components_thermal_model_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_add_thermal_model_components_thermal_model_post" + }, + "Body_create_component_data_from_file_components_upload_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_component_data_from_file_components_upload_file_post" + }, + "Body_create_file_items_components_upload_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_file_items_components_upload_post" + }, + "Body_create_from_file_drive_cycles_from_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_from_file_drive_cycles_from_file_post" + }, + "Body_import_concept_concepts_import_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_import_concept_concepts_import_post" + }, + "Body_upload_drive_cycle_file_drive_cycles_upload_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_upload_drive_cycle_file_drive_cycles_upload_file_post" + }, + "CapabilityCurve": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques" + }, + "powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Powers" + }, + "accelerations": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Accelerations", + "default": [] + }, + "motor_splits": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Motor Splits" + }, + "motor_names": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Motor Names" + }, + "errors": { + "additionalProperties": true, + "type": "object", + "title": "Errors", + "default": {} + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "powers", + "motor_splits", + "motor_names" + ], + "title": "CapabilityCurve", + "description": "Data to plot a capability curve." + }, + "CevJobStatus": { + "type": "string", + "enum": [ + "MIGRATED", + "NOT_MIGRATED" + ], + "title": "CevJobStatus", + "description": "CEV Job Status." + }, + "ComponentAxle": { + "type": "string", + "enum": [ + "Front", + "Rear", + "None" + ], + "title": "ComponentAxle", + "description": "Component axle." + }, + "ComponentConfigurationSet": { + "properties": { + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Configurations" + } + }, + "type": "object", + "title": "ComponentConfigurationSet", + "description": "Set of component configurations." + }, + "ComponentData": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLossMapDataInDB" + }, + { + "$ref": "#/components/schemas/MotorLabDataInDB" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesDataInDB" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableDataInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapDataInDB" + }, + { + "$ref": "#/components/schemas/InverterLossMapDataInDB" + } + ], + "title": "ComponentData", + "description": "Data that is used as a property of some components.", + "discriminator": { + "propertyName": "component_file_type", + "mapping": { + "BatteryLookupTable": "#/components/schemas/BatteryLookupTableDataInDB", + "InverterLossMap": "#/components/schemas/InverterLossMapDataInDB", + "MotorLab": "#/components/schemas/MotorLabDataInDB", + "MotorLossMap": "#/components/schemas/MotorLossMapDataInDB", + "MotorTorqueCurve": "#/components/schemas/MotorTorqueCurvesDataInDB", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMapDataInDB" + } + } + }, + "ComponentFileType": { + "type": "string", + "enum": [ + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "transmission_torque_grid_file", + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "thermal_model_file" + ], + "title": "ComponentFileType", + "description": "Types of files." + }, + "ComponentInDB": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInDB" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInputInDB" + }, + { + "$ref": "#/components/schemas/InverterAnalyticalInDB" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInDB" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapInDB" + }, + { + "$ref": "#/components/schemas/MotorLabInDB" + }, + { + "$ref": "#/components/schemas/MotorLossMapInDB" + } + ], + "title": "ComponentInDB", + "description": "A way to get the actual component from the Union.\n\nUse ComponentInDB().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-functions", + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInDB", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInDB", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "ClutchInput": "#/components/schemas/DisconnectClutchInputInDB", + "InverterAnalytical": "#/components/schemas/InverterAnalyticalInDB", + "InverterLossMapID": "#/components/schemas/InverterLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorLabModel": "#/components/schemas/MotorLabInDB", + "MotorLossMap": "#/components/schemas/MotorLossMapInDB", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurvesInDB", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInDB", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMapInDB", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID" + } + } + }, + "ComponentLossMapArgs": { + "properties": { + "voltage": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage" + }, + "gear_ratio": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Gear Ratio" + }, + "speed": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Speed" + }, + "dc_current": { + "type": "number", + "title": "Dc Current", + "default": 50 + }, + "power_factor": { + "type": "number", + "title": "Power Factor", + "default": 1 + }, + "phase_current_max": { + "type": "number", + "title": "Phase Current Max", + "default": 400 + }, + "frequency": { + "type": "number", + "title": "Frequency", + "default": 1000 + } + }, + "type": "object", + "title": "ComponentLossMapArgs", + "description": "Args for create component loss maps.\n\nAllows unit transforming." + }, + "ComponentSide": { + "type": "string", + "enum": [ + "Left", + "Right", + "None" + ], + "title": "ComponentSide", + "description": "Component side." + }, + "Concept": { + "properties": { + "concept_type": { + "type": "string", + "const": "not populated", + "title": "Concept Type", + "default": "not populated" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "type": "string", + "title": "User Id" + }, + "project_id": { + "type": "string", + "title": "Project Id" + }, + "design_id": { + "type": "string", + "title": "Design Id" + }, + "design_instance_id": { + "type": "string", + "title": "Design Instance Id" + }, + "architecture_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Architecture Id" + }, + "components_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Components Ids" + }, + "configurations_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Configurations Ids" + }, + "requirements_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirements Ids" + }, + "jobs_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Jobs Ids" + }, + "capabilities_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Capabilities Ids" + }, + "drive_cycles_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Drive Cycles Ids" + }, + "file_items_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Items Ids", + "default": [] + }, + "concept_settings_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Concept Settings Id" + } + }, + "type": "object", + "required": [ + "user_id", + "project_id", + "design_id", + "design_instance_id", + "components_ids", + "configurations_ids", + "requirements_ids", + "jobs_ids", + "capabilities_ids", + "drive_cycles_ids" + ], + "title": "Concept", + "description": "Concept." + }, + "ConceptCloneInput": { + "properties": { + "old_design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Old Design Instance Id" + }, + "old_design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Old Design Id" + }, + "copy_jobs": { + "type": "boolean", + "title": "Copy Jobs" + }, + "new_design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "New Design Instance Id" + }, + "new_design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "New Design Id" + } + }, + "type": "object", + "required": [ + "copy_jobs" + ], + "title": "ConceptCloneInput", + "description": "Inputs needed to clone/copy a concept." + }, + "ConceptPopulated": { + "properties": { + "concept_type": { + "type": "string", + "const": "populated", + "title": "Concept Type", + "default": "populated" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "type": "string", + "title": "User Id" + }, + "project_id": { + "type": "string", + "title": "Project Id" + }, + "design_id": { + "type": "string", + "title": "Design Id" + }, + "design_instance_id": { + "type": "string", + "title": "Design Instance Id" + }, + "architecture_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Architecture Id" + }, + "components_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Components Ids" + }, + "configurations_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Configurations Ids" + }, + "requirements_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirements Ids" + }, + "jobs_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Jobs Ids" + }, + "capabilities_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Capabilities Ids" + }, + "drive_cycles_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Drive Cycles Ids" + }, + "file_items_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Items Ids", + "default": [] + }, + "concept_settings_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Concept Settings Id" + }, + "architecture": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "type": "null" + } + ] + }, + "components": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ComponentInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Components" + }, + "configurations": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Configurations" + }, + "requirements": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Requirement" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Requirements" + }, + "jobs": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/JobData" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Jobs" + }, + "drive_cycles": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Drive Cycles" + }, + "file_items": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ComponentData" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "File Items" + }, + "concept_settings": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConceptSettings" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "user_id", + "project_id", + "design_id", + "design_instance_id", + "components_ids", + "configurations_ids", + "requirements_ids", + "jobs_ids", + "capabilities_ids", + "drive_cycles_ids" + ], + "title": "ConceptPopulated", + "description": "Expanded class with populated members." + }, + "ConceptSettings": { + "properties": { + "calculate_inertia": { + "type": "boolean", + "title": "Calculate Inertia", + "default": true + } + }, + "type": "object", + "title": "ConceptSettings", + "description": "Concept Settings Base Model." + }, + "ConceptUpdate": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + "type": "object", + "title": "ConceptUpdate", + "description": "Concept Updating Object." + }, + "ConfigurationInDB": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInDB" + }, + { + "$ref": "#/components/schemas/MassInDB" + }, + { + "$ref": "#/components/schemas/WheelInDB" + }, + { + "$ref": "#/components/schemas/DecelerationLimitInDB" + }, + { + "$ref": "#/components/schemas/AncillaryLoadInDB" + } + ], + "title": "ConfigurationInDB", + "description": "A way to get the actual config from the Union.\n\nUse ConfigurationInDB().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInDB", + "ancillary_load": "#/components/schemas/AncillaryLoadInDB", + "deceleration_limit": "#/components/schemas/DecelerationLimitInDB", + "mass": "#/components/schemas/MassInDB", + "wheel": "#/components/schemas/WheelInDB" + } + } + }, + "CurrentUnit": { + "type": "string", + "enum": [ + "A", + "mA", + "kA" + ], + "title": "CurrentUnit", + "description": "Current Unit." + }, + "DecelerationLimit": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Deceleration Limit" + }, + "limit": { + "type": "number", + "title": "Limit", + "default": -3.92 + }, + "config_type": { + "type": "string", + "const": "deceleration_limit", + "title": "Config Type", + "default": "deceleration_limit" + } + }, + "type": "object", + "title": "DecelerationLimit", + "description": "Deceleration Limit Configuration." + }, + "DecelerationLimitInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Deceleration Limit" + }, + "limit": { + "type": "number", + "title": "Limit", + "default": -3.92 + }, + "config_type": { + "type": "string", + "const": "deceleration_limit", + "title": "Config Type", + "default": "deceleration_limit" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DecelerationLimitInDB", + "description": "Deceleration limit with Database ID." + }, + "DensityUnit": { + "type": "string", + "enum": [ + "kg/m\u00b3", + "g/cm\u00b3" + ], + "title": "DensityUnit", + "description": "Density Unit." + }, + "DisconnectClutchInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Disconnect Clutch" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "ClutchInput", + "title": "Component Type", + "default": "ClutchInput" + }, + "efficiency": { + "type": "number", + "title": "Efficiency", + "default": 1 + } + }, + "type": "object", + "title": "DisconnectClutchInput", + "description": "Disconnect clutch input." + }, + "DisconnectClutchInputInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Disconnect Clutch" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "ClutchInput", + "title": "Component Type", + "default": "ClutchInput" + }, + "efficiency": { + "type": "number", + "title": "Efficiency", + "default": 1 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DisconnectClutchInputInDB", + "description": "Disconnect clutch In DB." + }, + "DriveCycle": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + } + }, + "type": "object", + "title": "DriveCycle", + "description": "Drive Cycle." + }, + "DriveCycleInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DriveCycleInDB", + "description": "Drive Cycle in Database." + }, + "DriveCycleRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "$ref": "#/components/schemas/DriveCycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + } + }, + "type": "object", + "required": [ + "drive_cycle" + ], + "title": "DriveCycleRequirement", + "description": "Drive Cycle Requirement Populated From Database." + }, + "DriveCycleRequirementIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Drive Cycle Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + }, + "starting_state_of_charge": { + "type": "number", + "title": "Starting State Of Charge", + "default": 1 + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": false + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementIds", + "description": "Drive Cycle Requirement ID linked." + }, + "DriveCycleS3": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + } + }, + "type": "object", + "required": [ + "submitted_job" + ], + "title": "DriveCycleS3", + "description": "Drive Cycle S3." + }, + "DriveCycleS3InDB": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "submitted_job" + ], + "title": "DriveCycleS3InDB", + "description": "Drive Cycle in Database." + }, + "DriveCycleSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "battery_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Battery Charge" + }, + "time": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Time" + }, + "distance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Distance" + }, + "vehicle_range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Vehicle Range" + }, + "efficiency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Efficiency" + }, + "total_values": { + "$ref": "#/components/schemas/TransientTotalValues" + }, + "requirement_solved_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Solved Type", + "default": "drive_cycle" + }, + "drive_cycle_requirement": { + "$ref": "#/components/schemas/DriveCycleRequirement" + }, + "torques_achieved": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques Achieved" + }, + "torques_drive_cycle": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques Drive Cycle" + }, + "points_achieved_ratio": { + "type": "number", + "title": "Points Achieved Ratio", + "default": 1.0 + }, + "points_not_achieved": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Points Not Achieved", + "default": [] + }, + "warnings": { + "additionalProperties": true, + "type": "object", + "title": "Warnings", + "default": {} + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "time", + "distance", + "drive_cycle_requirement", + "torques_achieved", + "torques_drive_cycle" + ], + "title": "DriveCycleSolved", + "description": "Solution to Drive Cycle given to APP." + }, + "DynamicRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + }, + "base_speed": { + "type": "number", + "title": "Base Speed" + }, + "end_time": { + "type": "number", + "title": "End Time" + }, + "end_distance": { + "type": "number", + "title": "End Distance" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + }, + "voltage_oc": { + "type": "number", + "title": "Voltage Oc" + }, + "requirement_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "base_speed", + "end_time", + "end_distance", + "points", + "voltage_oc" + ], + "title": "DynamicRequirement", + "description": "Dynamic Requirements." + }, + "DynamicRequirementInputsIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Dynamic Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "dynamic_input", + "title": "Requirement Type", + "default": "dynamic_input" + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 27.77777777777778 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 5 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": true + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementInputsIds", + "description": "Dynamic Requirement Inputs ID linked." + }, + "DynamicRequirementSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "battery_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Battery Charge" + }, + "time": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Time" + }, + "distance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Distance" + }, + "vehicle_range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Vehicle Range" + }, + "efficiency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Efficiency" + }, + "total_values": { + "$ref": "#/components/schemas/TransientTotalValues" + }, + "requirement_solved_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Solved Type", + "default": "dynamic" + }, + "requirement": { + "$ref": "#/components/schemas/DynamicRequirement" + }, + "requirements": { + "items": { + "$ref": "#/components/schemas/StaticRequirement" + }, + "type": "array", + "title": "Requirements" + }, + "traction_limits": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/StaticRequirement" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Traction Limits" + }, + "capability_curve": { + "anyOf": [ + { + "$ref": "#/components/schemas/CapabilityCurve" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Error Code" + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "time", + "distance", + "requirement", + "requirements", + "traction_limits", + "capability_curve" + ], + "title": "DynamicRequirementSolved", + "description": "Solution to dynamic requirement given to APP." + }, + "ElectricChargeUnit": { + "type": "string", + "enum": [ + "A\u00b7s" + ], + "title": "ElectricChargeUnit", + "description": "Unit of Electrical Charge." + }, + "ElectricalEnergyUnit": { + "type": "string", + "enum": [ + "J", + "kWh", + "VA\u00b7hr", + "Wh" + ], + "title": "ElectricalEnergyUnit", + "description": "Unit of Electrical Energy." + }, + "ElectricalPowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "VA", + "kVA" + ], + "title": "ElectricalPowerUnit", + "description": "Unit of Electrical Power." + }, + "EnergyUnit": { + "type": "string", + "enum": [ + "J", + "kJ", + "MJ", + "mJ", + "Wh", + "kWh" + ], + "title": "EnergyUnit", + "description": "Energy Unit." + }, + "ExchangeFile": { + "properties": { + "note": { + "type": "string", + "title": "Note", + "default": "This file format is intended as a transport file\n format and may not remain backwards compatible." + }, + "date_created": { + "type": "string", + "title": "Date Created" + }, + "api_version": { + "type": "string", + "title": "Api Version" + }, + "concept": { + "$ref": "#/components/schemas/ConceptPopulated" + }, + "blobs": { + "items": { + "$ref": "#/components/schemas/Blob" + }, + "type": "array", + "title": "Blobs" + } + }, + "type": "object", + "required": [ + "date_created", + "api_version", + "concept", + "blobs" + ], + "title": "ExchangeFile", + "description": "Exchange File Model." + }, + "FileParameters": { + "properties": { + "component_file_type": { + "$ref": "#/components/schemas/ComponentFileType" + }, + "hpc_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Hpc Id", + "deprecated": true + }, + "file_hash": { + "type": "string", + "title": "File Hash" + }, + "file_size": { + "type": "integer", + "title": "File Size" + }, + "account_id": { + "type": "string", + "title": "Account Id" + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag", + "default": "latest" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + "type": "object", + "required": [ + "component_file_type", + "file_hash", + "file_size", + "account_id" + ], + "title": "FileParameters", + "description": "File Parameters." + }, + "ForceUnit": { + "type": "string", + "enum": [ + "N", + "lbf", + "dyn" + ], + "title": "ForceUnit", + "description": "Force Unit." + }, + "FrequencyUnit": { + "type": "string", + "enum": [ + "Hz" + ], + "title": "FrequencyUnit", + "description": "Unit of frequency." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InertiaUnit": { + "type": "string", + "enum": [ + "kg\u00b7m\u00b2", + "g\u00b7mm\u00b2" + ], + "title": "InertiaUnit", + "description": "Inertia Unit." + }, + "InverterAnalytical": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Analytical Inverter" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "InverterAnalytical", + "title": "Component Type", + "default": "InverterAnalytical" + }, + "inverter_data": { + "oneOf": [ + { + "$ref": "#/components/schemas/InverterSimpleData" + }, + { + "$ref": "#/components/schemas/InverterIGBTData" + }, + { + "$ref": "#/components/schemas/InverterMOSFETData" + } + ], + "title": "Inverter Data", + "discriminator": { + "propertyName": "inverter_type", + "mapping": { + "IGBT": "#/components/schemas/InverterIGBTData", + "MOSFET": "#/components/schemas/InverterMOSFETData", + "simple": "#/components/schemas/InverterSimpleData" + } + } + }, + "current_limit_rms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Current Limit Rms" + } + }, + "type": "object", + "required": [ + "inverter_data" + ], + "title": "InverterAnalytical", + "description": "Analytical inverter input." + }, + "InverterAnalyticalInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Analytical Inverter" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "InverterAnalytical", + "title": "Component Type", + "default": "InverterAnalytical" + }, + "inverter_data": { + "oneOf": [ + { + "$ref": "#/components/schemas/InverterSimpleData" + }, + { + "$ref": "#/components/schemas/InverterIGBTData" + }, + { + "$ref": "#/components/schemas/InverterMOSFETData" + } + ], + "title": "Inverter Data", + "discriminator": { + "propertyName": "inverter_type", + "mapping": { + "IGBT": "#/components/schemas/InverterIGBTData", + "MOSFET": "#/components/schemas/InverterMOSFETData", + "simple": "#/components/schemas/InverterSimpleData" + } + } + }, + "current_limit_rms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Current Limit Rms" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "inverter_data" + ], + "title": "InverterAnalyticalInDB", + "description": "Inverter model in DB." + }, + "InverterIGBTData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "switching_energy_on": { + "type": "number", + "title": "Switching Energy On", + "default": 0.112 + }, + "switching_energy_off": { + "type": "number", + "title": "Switching Energy Off", + "default": 0.09 + }, + "switching_energy_reverse": { + "type": "number", + "title": "Switching Energy Reverse", + "default": 0.036 + }, + "voltage_ref": { + "type": "number", + "title": "Voltage Ref", + "default": 600 + }, + "current_ref": { + "type": "number", + "title": "Current Ref", + "default": 800 + }, + "pwm_frequency": { + "type": "number", + "title": "Pwm Frequency", + "default": 20000 + }, + "pwm_ratio": { + "type": "number", + "title": "Pwm Ratio", + "default": 1 + }, + "pwm_definition": { + "$ref": "#/components/schemas/PWMFrequencyDefinition", + "default": 1 + }, + "diode_voltage_drop": { + "type": "number", + "title": "Diode Voltage Drop", + "default": 1 + }, + "diode_dynamic_resistance": { + "type": "number", + "title": "Diode Dynamic Resistance", + "default": 0.00222 + }, + "transistor_voltage_drop": { + "type": "number", + "title": "Transistor Voltage Drop", + "default": 0.85 + }, + "transistor_dynamic_resistance": { + "type": "number", + "title": "Transistor Dynamic Resistance", + "default": 0.00094 + }, + "inverter_type": { + "type": "string", + "const": "IGBT", + "title": "Inverter Type", + "default": "IGBT" + } + }, + "type": "object", + "title": "InverterIGBTData", + "description": "Wrapper for inverter IGBT model to handle units and default values." + }, + "InverterLossMapDataInDB": { + "properties": { + "phase_currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Phase Currents" + }, + "dc_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Dc Voltages" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "voltage_drops": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Voltage Drops" + }, + "bounds": { + "type": "null", + "title": "Bounds" + }, + "component_file_type": { + "type": "string", + "const": "InverterLossMap", + "title": "Component File Type", + "default": "InverterLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "phase_currents", + "dc_voltages", + "losses", + "voltage_drops" + ], + "title": "InverterLossMapDataInDB", + "description": "Loss Map in Database." + }, + "InverterLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "InverterLossMapID", + "title": "Component Type", + "default": "InverterLossMapID" + }, + "alternative_voltage_drop": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Alternative Voltage Drop" + } + }, + "type": "object", + "title": "InverterLossMapID", + "description": "Inverter Loss Map ID." + }, + "InverterMOSFETData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "switching_energy_on": { + "type": "number", + "title": "Switching Energy On", + "default": 0.021 + }, + "switching_energy_off": { + "type": "number", + "title": "Switching Energy Off", + "default": 0.018 + }, + "switching_energy_reverse": { + "type": "number", + "title": "Switching Energy Reverse", + "default": 0.004 + }, + "voltage_ref": { + "type": "number", + "title": "Voltage Ref", + "default": 600 + }, + "current_ref": { + "type": "number", + "title": "Current Ref", + "default": 800 + }, + "pwm_frequency": { + "type": "number", + "title": "Pwm Frequency", + "default": 20000 + }, + "pwm_ratio": { + "type": "number", + "title": "Pwm Ratio", + "default": 1 + }, + "pwm_definition": { + "$ref": "#/components/schemas/PWMFrequencyDefinition", + "default": 1 + }, + "diode_voltage_drop": { + "type": "number", + "title": "Diode Voltage Drop", + "default": 2.1 + }, + "diode_dynamic_resistance": { + "type": "number", + "title": "Diode Dynamic Resistance", + "default": 0.0018 + }, + "drain_source_on_resistance": { + "type": "number", + "title": "Drain Source On Resistance", + "default": 0.0018 + }, + "inverter_type": { + "type": "string", + "const": "MOSFET", + "title": "Inverter Type", + "default": "MOSFET" + } + }, + "type": "object", + "title": "InverterMOSFETData", + "description": "Wrapper for inverter MOSFET model to handle units and defaults." + }, + "InverterSimpleData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "ac_resistance": { + "type": "number", + "title": "Ac Resistance", + "default": 0 + }, + "dc_resistance": { + "type": "number", + "title": "Dc Resistance", + "default": 0 + }, + "switch_resistance": { + "type": "number", + "title": "Switch Resistance", + "default": 0 + }, + "switch_forward_voltage": { + "type": "number", + "title": "Switch Forward Voltage", + "default": 0 + }, + "switching_time": { + "type": "number", + "title": "Switching Time", + "default": 0 + }, + "switch_per_pwm_period": { + "type": "integer", + "title": "Switch Per Pwm Period", + "default": 0 + }, + "fixed_loss": { + "type": "number", + "title": "Fixed Loss", + "default": 0 + }, + "inverter_type": { + "type": "string", + "const": "simple", + "title": "Inverter Type", + "default": "simple" + } + }, + "type": "object", + "title": "InverterSimpleData", + "description": "Wrapper for inverter simple model to handle units." + }, + "ItemAndBlobs": { + "properties": { + "item_type": { + "type": "string", + "const": "item_and_blobs", + "title": "Item Type", + "default": "item_and_blobs" + }, + "component": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Component" + }, + "blobs": { + "items": { + "$ref": "#/components/schemas/Blob" + }, + "type": "array", + "title": "Blobs" + } + }, + "type": "object", + "required": [ + "component", + "blobs" + ], + "title": "ItemAndBlobs", + "description": "Item with blobs.\n\nUsed in the library to detect whether this is item that has associated S3 blobs." + }, + "Job": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "trace_id": { + "type": "string", + "title": "Trace Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "ram_estimate": { + "type": "integer", + "title": "Ram Estimate", + "default": 4000 + }, + "requirements": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Requirements" + } + }, + "type": "object", + "required": [ + "id", + "trace_id", + "name" + ], + "title": "Job", + "description": "Job model." + }, + "JobData": { + "properties": { + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + }, + "date": { + "type": "number", + "title": "Date" + }, + "cev_status": { + "$ref": "#/components/schemas/CevJobStatus" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "encrypted": { + "type": "boolean", + "title": "Encrypted" + } + }, + "type": "object", + "required": [ + "submitted_job", + "date", + "cev_status", + "filename", + "encrypted" + ], + "title": "JobData", + "description": "Job Data." + }, + "JobInput": { + "properties": { + "job_name": { + "type": "string", + "title": "Job Name" + }, + "requirement_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirement Ids" + }, + "architecture_id": { + "type": "string", + "title": "Architecture Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + "type": "object", + "required": [ + "job_name", + "requirement_ids", + "architecture_id" + ], + "title": "JobInput", + "description": "Job Input." + }, + "JobStart": { + "properties": { + "job": { + "$ref": "#/components/schemas/Job" + }, + "uploaded_file": { + "$ref": "#/components/schemas/UploadedFile" + }, + "account_id": { + "type": "string", + "title": "Account Id" + }, + "hpc_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Hpc Id", + "deprecated": true + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag", + "default": "default" + }, + "extra_memory": { + "type": "boolean", + "title": "Extra Memory", + "default": false + } + }, + "type": "object", + "required": [ + "job", + "uploaded_file", + "account_id" + ], + "title": "JobStart", + "description": "Job Start." + }, + "JobStatus": { + "properties": { + "status": { + "anyOf": [ + { + "$ref": "#/components/schemas/Statuses" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "JobStatus", + "description": "Status of the Job." + }, + "LengthUnit": { + "type": "string", + "enum": [ + "m", + "mm", + "cm", + "in", + "ft", + "yd", + "km", + "miles" + ], + "title": "LengthUnit", + "description": "Length Unit." + }, + "Mass": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + } + }, + "type": "object", + "title": "Mass", + "description": "Mass Configuration." + }, + "MassInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "MassInDB", + "description": "Mass config with Database ID." + }, + "MassUnit": { + "type": "string", + "enum": [ + "kg", + "g", + "lb", + "oz", + "t", + "LT", + "tn" + ], + "title": "MassUnit", + "description": "Mass Unit." + }, + "MotorConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "motor", + "title": "Component Config Type", + "default": "motor" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "state": { + "$ref": "#/components/schemas/MotorState", + "default": {} + } + }, + "type": "object", + "title": "MotorConfiguration", + "description": "Configuration that can change characteristics of the motor." + }, + "MotorLab": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "$ref": "#/components/schemas/MotorLabData" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + } + }, + "type": "object", + "required": [ + "lab_data", + "max_speed" + ], + "title": "MotorLab", + "description": "Create Motor From Lab Model." + }, + "MotorLabData": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabData", + "description": "Motor Lab Data.\n\nModel is held as a dict, exported from Lab." + }, + "MotorLabDataInDB": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabDataInDB", + "description": "Lab dictionary in Database.\n\nCan also contain the thermal model." + }, + "MotorLabID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "component_type": { + "type": "string", + "const": "MotorLabID", + "title": "Component Type", + "default": "MotorLabID" + } + }, + "type": "object", + "required": [ + "max_speed" + ], + "title": "MotorLabID", + "description": "Motor Lab with the data referenced by ID." + }, + "MotorLabInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "$ref": "#/components/schemas/MotorLabData" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "lab_data", + "max_speed" + ], + "title": "MotorLabInDB", + "description": "Motor in Database." + }, + "MotorLossMap": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component Type", + "default": "MotorLossMap" + }, + "loss_map": { + "$ref": "#/components/schemas/MotorLossMapData" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "MotorLossMap", + "description": "Create Motor from Loss Map." + }, + "MotorLossMapData": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "currents": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Currents" + }, + "power_factors": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Power Factors" + }, + "component_file_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component File Type", + "default": "MotorLossMap" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages", + "losses" + ], + "title": "MotorLossMapData", + "description": "Motor Loss Map.\n\nInput lists are two-dimensional, with each sub-list referring to\na different voltage." + }, + "MotorLossMapDataInDB": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "currents": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Currents" + }, + "power_factors": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Power Factors" + }, + "component_file_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component File Type", + "default": "MotorLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages", + "losses" + ], + "title": "MotorLossMapDataInDB", + "description": "Loss Map in Database." + }, + "MotorLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages", + "default": [] + }, + "component_type": { + "type": "string", + "const": "MotorLossMapID", + "title": "Component Type", + "default": "MotorLossMapID" + } + }, + "type": "object", + "title": "MotorLossMapID", + "description": "Motor Loss Map ID. Data referenced by ID." + }, + "MotorLossMapInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component Type", + "default": "MotorLossMap" + }, + "loss_map": { + "$ref": "#/components/schemas/MotorLossMapData" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "MotorLossMapInDB", + "description": "Motor in Database." + }, + "MotorState": { + "properties": { + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "stator_winding_temp_peak": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp Peak" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "airgap_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Airgap Temp" + }, + "bearing_temp_front": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Front" + }, + "bearing_temp_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Rear" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + } + }, + "type": "object", + "title": "MotorState", + "description": "Variables that define state of a motor.\n\nEssentially these are mostly all inputs to a Lab operating point calculation." + }, + "MotorThermalLimits": { + "properties": { + "stator": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator" + }, + "rotor": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor" + }, + "stator_limit_type": { + "type": "string", + "title": "Stator Limit Type", + "default": "average" + } + }, + "type": "object", + "title": "MotorThermalLimits", + "description": "Thermal limits for motor components." + }, + "MotorTorqueCurves": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurves", + "title": "Component Type", + "default": "MotorTorqueCurves" + }, + "torque_curves": { + "$ref": "#/components/schemas/MotorTorqueCurvesData" + } + }, + "type": "object", + "required": [ + "torque_curves" + ], + "title": "MotorTorqueCurves", + "description": "Create a motor from torque speed curves." + }, + "MotorTorqueCurvesData": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "generating_torques": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Torques" + }, + "generating_speeds": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Speeds" + }, + "component_file_type": { + "type": "string", + "const": "MotorTorqueCurve", + "title": "Component File Type", + "default": "MotorTorqueCurve" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages" + ], + "title": "MotorTorqueCurvesData", + "description": "Motor torque curve data.\n\nInput lists are two-dimensional, with each sub-list referring to\na different voltage." + }, + "MotorTorqueCurvesDataInDB": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "generating_torques": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Torques" + }, + "generating_speeds": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Speeds" + }, + "component_file_type": { + "type": "string", + "const": "MotorTorqueCurve", + "title": "Component File Type", + "default": "MotorTorqueCurve" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages" + ], + "title": "MotorTorqueCurvesDataInDB", + "description": "Torque curves in Database." + }, + "MotorTorqueCurvesID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurveID", + "title": "Component Type", + "default": "MotorTorqueCurveID" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages", + "default": [] + } + }, + "type": "object", + "title": "MotorTorqueCurvesID", + "description": "Motor Lab with the data referenced by ID." + }, + "MotorTorqueCurvesInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurves", + "title": "Component Type", + "default": "MotorTorqueCurves" + }, + "torque_curves": { + "$ref": "#/components/schemas/MotorTorqueCurvesData" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "torque_curves" + ], + "title": "MotorTorqueCurvesInDB", + "description": "Motor in Database." + }, + "PWMFrequencyDefinition": { + "type": "integer", + "enum": [ + 1, + 2, + 3 + ], + "title": "PWMFrequencyDefinition", + "description": "How user has defined PWM frequency." + }, + "PartNames": { + "type": "string", + "enum": [ + "architecture", + "components", + "configurations", + "requirements", + "drive_cycles", + "file_items" + ], + "title": "PartNames", + "description": "Part Names." + }, + "PowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "mW", + "MW", + "hp", + "hp" + ], + "title": "PowerUnit", + "description": "Power Unit." + }, + "PressureUnit": { + "type": "string", + "enum": [ + "Pa", + "kPa", + "MPa", + "psi" + ], + "title": "PressureUnit", + "description": "Pressure Unit." + }, + "RatioUnit": { + "type": "string", + "enum": [ + "", + "%" + ], + "title": "RatioUnit", + "description": "Ratio Unit." + }, + "Requirement": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementIds" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInputsIds" + }, + { + "$ref": "#/components/schemas/StaticRequirementAccelerationIds" + } + ], + "title": "Requirement", + "description": "A way to get the actual requirement from the Union.\n\nUse Requirement().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "requirement_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementIds", + "dynamic_input": "#/components/schemas/DynamicRequirementInputsIds", + "static_acceleration": "#/components/schemas/StaticRequirementAccelerationIds" + } + } + }, + "RequirementsSolved": { + "oneOf": [ + { + "$ref": "#/components/schemas/StaticRequirementSolved" + }, + { + "$ref": "#/components/schemas/DynamicRequirementSolved" + }, + { + "$ref": "#/components/schemas/DriveCycleSolved" + } + ], + "title": "RequirementsSolved", + "description": "A way to get the actual component from the Union.\n\nUse RequirementsSolved() uses keywords arguments or dictionary.\nuse RequirementsSolved.model_validate() on an object or dictionary .\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "requirement_solved_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleSolved", + "dynamic": "#/components/schemas/DynamicRequirementSolved", + "static": "#/components/schemas/StaticRequirementSolved" + } + } + }, + "ResistanceUnit": { + "type": "string", + "enum": [ + "ohm" + ], + "title": "ResistanceUnit", + "description": "Resistance Unit." + }, + "RoadEfficiencyUnit": { + "type": "string", + "enum": [ + "m/J", + "km/kWh", + "miles/kWh", + "MPGe" + ], + "title": "RoadEfficiencyUnit", + "description": "Unit of Road Efficiency." + }, + "SolvedBattery": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "battery", + "title": "Solved Component Type", + "default": "battery" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "out_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Voltages" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "out_voltages" + ], + "title": "SolvedBattery", + "description": "Solved battery node." + }, + "SolvedDisconnectClutch": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "clutch", + "title": "Solved Component Type", + "default": "clutch" + }, + "in_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Speeds" + }, + "out_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "disconnected": { + "items": { + "type": "boolean" + }, + "type": "array", + "title": "Disconnected" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_speeds", + "out_speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedDisconnectClutch", + "description": "Solved clutch." + }, + "SolvedInverter": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "inverter", + "title": "Solved Component Type", + "default": "inverter" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "out_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Voltages" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "modulation_depths": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Modulation Depths" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "out_voltages" + ], + "title": "SolvedInverter", + "description": "Solved inverter node." + }, + "SolvedMotor": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "motor", + "title": "Solved Component Type", + "default": "motor" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "currents_d": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents D" + }, + "currents_q": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents Q" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "power_factors": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Power Factors" + }, + "temperatures_stator_winding": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Stator Winding" + }, + "temperatures_stator_winding_peak": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Stator Winding Peak" + }, + "temperatures_rotor": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Rotor" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "speeds", + "in_torques", + "out_torques", + "currents_d", + "currents_q" + ], + "title": "SolvedMotor", + "description": "Solved motor node." + }, + "SolvedRoad": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "road", + "title": "Solved Component Type", + "default": "road" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedRoad", + "description": "Solved road node." + }, + "SolvedTransmission": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "transmission", + "title": "Solved Component Type", + "default": "transmission" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "gear_ratios_optimal": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios Optimal", + "default": [ + 0 + ] + }, + "in_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Speeds" + }, + "out_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "losses_torque": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Torque" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "gear_ratios", + "in_speeds", + "out_speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedTransmission", + "description": "Solved transmission node." + }, + "SolvedWheel": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "wheel", + "title": "Solved Component Type", + "default": "wheel" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedWheel", + "description": "Solved wheel node." + }, + "SpeedUnit": { + "type": "string", + "enum": [ + "m/s", + "km/hr", + "mph", + "ft/s" + ], + "title": "SpeedUnit", + "description": "Speed Unit." + }, + "StandardDriveCycles": { + "type": "string", + "enum": [ + "WLTP3", + "US06", + "UDDS", + "HWFET" + ], + "title": "StandardDriveCycles", + "description": "Standard Drive Cycles." + }, + "StaticRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + }, + "total_tractive_torque": { + "type": "number", + "title": "Total Tractive Torque" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "aero_force": { + "type": "number", + "title": "Aero Force" + }, + "mass_force": { + "type": "number", + "title": "Mass Force" + }, + "rolling_resistance_force": { + "type": "number", + "title": "Rolling Resistance Force" + }, + "total_force": { + "type": "number", + "title": "Total Force" + }, + "total_tractive_power": { + "type": "number", + "title": "Total Tractive Power" + }, + "voltage_oc": { + "type": "number", + "title": "Voltage Oc" + } + }, + "type": "object", + "required": [ + "speed", + "total_tractive_torque", + "acceleration", + "aero_force", + "mass_force", + "rolling_resistance_force", + "total_force", + "total_tractive_power", + "voltage_oc" + ], + "title": "StaticRequirement", + "description": "Static requirement with both torque and acceleration." + }, + "StaticRequirementAccelerationIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Static Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "static_acceleration", + "title": "Requirement Type", + "default": "static_acceleration" + }, + "speed": { + "type": "number", + "title": "Speed", + "default": 27.77777777777778 + }, + "acceleration": { + "type": "number", + "title": "Acceleration", + "default": 0 + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "StaticRequirementAccelerationIds", + "description": "Static Requirement (acceleration) ID linked." + }, + "StaticRequirementSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "requirement_solved_type": { + "type": "string", + "const": "static", + "title": "Requirement Solved Type", + "default": "static" + }, + "requirement": { + "$ref": "#/components/schemas/StaticRequirement" + }, + "traction_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/StaticRequirement" + }, + { + "type": "null" + } + ] + }, + "capability_curve": { + "anyOf": [ + { + "$ref": "#/components/schemas/CapabilityCurve" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Error Code" + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "requirement", + "traction_limit", + "capability_curve" + ], + "title": "StaticRequirementSolved", + "description": "Solution to static requirement given to APP." + }, + "Statuses": { + "type": "string", + "enum": [ + "FINISHED", + "QUEUED", + "RUNNING", + "FAILED" + ], + "title": "Statuses", + "description": "Statuses." + }, + "SubmittedJob": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "job_name": { + "type": "string", + "title": "Job Name" + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag" + }, + "simulation_id": { + "type": "string", + "title": "Simulation Id" + } + }, + "type": "object", + "required": [ + "job_id", + "job_name", + "docker_tag", + "simulation_id" + ], + "title": "SubmittedJob", + "description": "Submitted Job." + }, + "SurfaceConditionTractionConfigs": { + "type": "string", + "enum": [ + "Snow", + "Wet", + "Dry" + ], + "title": "SurfaceConditionTractionConfigs", + "description": "Surface conditions that affect the traction coefficient." + }, + "TemperatureUnit": { + "type": "string", + "enum": [ + "K", + "\u00b0C", + "\u00b0F" + ], + "title": "TemperatureUnit", + "description": "Temperature Unit." + }, + "Template": { + "properties": { + "_id": { + "type": "string", + "title": "Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id", + "deprecated": true + }, + "design_identifier": { + "type": "string", + "title": "Design Identifier" + }, + "name": { + "type": "string", + "title": "Name" + } + }, + "type": "object", + "required": [ + "design_identifier", + "name" + ], + "title": "Template", + "description": "Template." + }, + "ThermalModelDetails": { + "properties": { + "model_type": { + "$ref": "#/components/schemas/ThermalModelType", + "default": "None" + }, + "speeds": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Speeds" + }, + "flow_rates": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Flow Rates" + } + }, + "type": "object", + "title": "ThermalModelDetails", + "description": "Thermal Model Details." + }, + "ThermalModelSolver": { + "properties": { + "component_file_type": { + "type": "string", + "const": "ThermalModel", + "title": "Component File Type", + "default": "ThermalModel" + }, + "network": { + "$ref": "#/components/schemas/ThermalNetwork" + }, + "loss_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Loss Map" + }, + "temperature_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Temperature Map" + } + }, + "type": "object", + "required": [ + "network", + "loss_map", + "temperature_map" + ], + "title": "ThermalModelSolver", + "description": "Thermal model.\n\nContains the thermal network defined by nodes and edges, and mappings of which nodes\ncorrespond to which losses and temperatures." + }, + "ThermalModelType": { + "type": "string", + "enum": [ + "None", + "OneDimension", + "TwoDimension" + ], + "title": "ThermalModelType", + "description": "Types of thermal model." + }, + "ThermalNetwork": { + "properties": { + "network_dict": { + "additionalProperties": { + "type": "object", + "description": "A NetworkX DiGraph serialized as node-link data." + }, + "type": "object", + "title": "Network Dict" + }, + "speed_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Speed Dict" + }, + "flow_rate_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Flow Rate Dict" + } + }, + "type": "object", + "required": [ + "network_dict", + "speed_dict", + "flow_rate_dict" + ], + "title": "ThermalNetwork", + "description": "Lumped parameter thermal network.\n\nIt is constructed from sets of nodes and edges (connections) at different speeds\nand flow rates.\n\nFields:\n speed_dict (dict): Dictionary mapping indices to speed values.\n flow_rate_dict (dict): Dictionary mapping indices to flow rate values.\n edges (dict): Dictionary mapping indices to edge lists.\n nodes (dict): Dictionary mapping indices to node lists." + }, + "TimeUnit": { + "type": "string", + "enum": [ + "s", + "ms", + "min", + "hr" + ], + "title": "TimeUnit", + "description": "Time Unit." + }, + "TorqueUnit": { + "type": "string", + "enum": [ + "N\u00b7m", + "ft\u00b7lbf", + "kN\u00b7m", + "MN\u00b7m", + "dyn\u00b7cm" + ], + "title": "TorqueUnit", + "description": "Torque Unit." + }, + "TotalTractiveTorqueGraph": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "total_tractive_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Torques" + }, + "aero_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Aero Forces" + }, + "mass_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Mass Forces" + }, + "total_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Forces" + }, + "total_tractive_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Powers" + } + }, + "type": "object", + "required": [ + "speeds", + "acceleration", + "total_tractive_torques", + "aero_forces", + "mass_forces", + "total_forces", + "total_tractive_powers" + ], + "title": "TotalTractiveTorqueGraph", + "description": "Total Tractive Torque Graph." + }, + "TransientCalculationPoint": { + "properties": { + "index": { + "type": "integer", + "title": "Index" + }, + "duration": { + "type": "number", + "title": "Duration" + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "gradient": { + "type": "number", + "title": "Gradient" + }, + "distance": { + "type": "number", + "title": "Distance" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "headwind": { + "type": "number", + "title": "Headwind" + }, + "altitude": { + "type": "number", + "title": "Altitude" + }, + "charging_power": { + "type": "number", + "title": "Charging Power", + "default": 0.0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "ancillary_load": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load" + } + }, + "type": "object", + "required": [ + "index", + "duration", + "speed", + "gradient", + "distance", + "acceleration", + "headwind", + "altitude" + ], + "title": "TransientCalculationPoint", + "description": "Drive Cycle Point.\n\nindex (int): index of the point within the calculation\nduration (float): length of the time step\nspeed (float): speed at the end of the time step\ngradient (float): gradient of the time step\ndistance (float): distance travelled during the time step\nacceleration (float): acceleration during the time step, calculate from\n the speed of this point and the previous point" + }, + "TransientTotalValues": { + "properties": { + "energy_consumed": { + "type": "number", + "title": "Energy Consumed", + "default": 0 + }, + "energy_recovered": { + "type": "number", + "title": "Energy Recovered", + "default": 0 + }, + "net_energy_consumed": { + "type": "number", + "title": "Net Energy Consumed", + "default": 0 + }, + "energy_charging": { + "type": "number", + "title": "Energy Charging", + "default": 0 + }, + "aero_contribution": { + "type": "number", + "title": "Aero Contribution", + "default": 0 + }, + "rolling_resistance_contribution": { + "type": "number", + "title": "Rolling Resistance Contribution", + "default": 0 + }, + "mass_contribution": { + "type": "number", + "title": "Mass Contribution", + "default": 0 + }, + "ancillary_load": { + "type": "number", + "title": "Ancillary Load", + "default": 0 + }, + "loss_by_component": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Loss By Component" + }, + "loss_by_component_ratio": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Loss By Component Ratio" + }, + "efficiency_by_component": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Efficiency By Component" + } + }, + "type": "object", + "title": "TransientTotalValues", + "description": "Total values over the course of a transient calculation." + }, + "TransmissionLossCoefficients": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + } + }, + "type": "object", + "title": "TransmissionLossCoefficients", + "description": "Input values for transmission model for fixed efficiencies." + }, + "TransmissionLossCoefficientsInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "TransmissionLossCoefficientsInDB", + "description": "Transmission In DB." + }, + "TransmissionLossMap": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Loss Map Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component Type", + "default": "TransmissionLossMap" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "loss_map": { + "$ref": "#/components/schemas/TransmissionLossMapData" + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "TransmissionLossMap", + "description": "Input values for transmission model with loss data." + }, + "TransmissionLossMapData": { + "properties": { + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "component_file_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component File Type", + "default": "TransmissionLossMap" + } + }, + "type": "object", + "required": [ + "gear_ratios", + "speeds", + "torques", + "losses", + "efficiencies" + ], + "title": "TransmissionLossMapData", + "description": "Data for transmission loss maps.\n\n2D lists, one list per gear ratio." + }, + "TransmissionLossMapDataInDB": { + "properties": { + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "component_file_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component File Type", + "default": "TransmissionLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "gear_ratios", + "speeds", + "torques", + "losses", + "efficiencies" + ], + "title": "TransmissionLossMapDataInDB", + "description": "Loss Map in Database." + }, + "TransmissionLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [] + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMapID", + "title": "Component Type", + "default": "TransmissionLossMapID" + } + }, + "type": "object", + "title": "TransmissionLossMapID", + "description": "Transmission Loss Map ID. Data referenced by ID." + }, + "TransmissionLossMapInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Loss Map Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component Type", + "default": "TransmissionLossMap" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "loss_map": { + "$ref": "#/components/schemas/TransmissionLossMapData" + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "TransmissionLossMapInDB", + "description": "Transmission In DB." + }, + "TransmissionNeglect": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionNeglect", + "title": "Component Type", + "default": "TransmissionNeglect" + } + }, + "type": "object", + "title": "TransmissionNeglect", + "description": "Placeholder class for when neglecting transmission.\n\nThis is used when we have in wheel motors." + }, + "UnitChoices": { + "properties": { + "unit_type_to_unit_map": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/MassUnit" + }, + { + "$ref": "#/components/schemas/TimeUnit" + }, + { + "$ref": "#/components/schemas/ForceUnit" + }, + { + "$ref": "#/components/schemas/TorqueUnit" + }, + { + "$ref": "#/components/schemas/TemperatureUnit" + }, + { + "$ref": "#/components/schemas/LengthUnit" + }, + { + "$ref": "#/components/schemas/AreaUnit" + }, + { + "$ref": "#/components/schemas/VolumeUnit" + }, + { + "$ref": "#/components/schemas/SpeedUnit" + }, + { + "$ref": "#/components/schemas/AccelerationUnit" + }, + { + "$ref": "#/components/schemas/AngularSpeedUnit" + }, + { + "$ref": "#/components/schemas/AngularAccelerationUnit" + }, + { + "$ref": "#/components/schemas/EnergyUnit" + }, + { + "$ref": "#/components/schemas/PowerUnit" + }, + { + "$ref": "#/components/schemas/DensityUnit" + }, + { + "$ref": "#/components/schemas/InertiaUnit" + }, + { + "$ref": "#/components/schemas/PressureUnit" + }, + { + "$ref": "#/components/schemas/RatioUnit" + }, + { + "$ref": "#/components/schemas/VoltageUnit" + }, + { + "$ref": "#/components/schemas/CurrentUnit" + }, + { + "$ref": "#/components/schemas/ResistanceUnit" + }, + { + "$ref": "#/components/schemas/ElectricChargeUnit" + }, + { + "$ref": "#/components/schemas/ElectricalEnergyUnit" + }, + { + "$ref": "#/components/schemas/ElectricalPowerUnit" + }, + { + "$ref": "#/components/schemas/AngleUnit" + }, + { + "$ref": "#/components/schemas/RoadEfficiencyUnit" + }, + { + "$ref": "#/components/schemas/FrequencyUnit" + }, + { + "$ref": "#/components/schemas/VolumetricFlowRateUnit" + } + ] + }, + "type": "object", + "title": "Unit Type To Unit Map", + "default": { + "mass": "kg", + "time": "s", + "force": "N", + "torque": "N\u00b7m", + "temperature": "\u00b0C", + "length": "m", + "distance": "km", + "area": "m\u00b2", + "volume": "m\u00b3", + "speed": "km/hr", + "acceleration": "m/s\u00b2", + "angular_speed": "rpm", + "angular_acceleration": "rps/s", + "energy": "J", + "power": "kW", + "density": "kg/m\u00b3", + "inertia": "kg\u00b7m\u00b2", + "pressure": "Pa", + "ratio": "%", + "voltage": "V", + "current": "A", + "resistance": "ohm", + "electric_charge": "A\u00b7s", + "electrical_energy": "kWh", + "electrical_power": "kW", + "gradient": "deg", + "road_efficiency": "km/kWh", + "frequency": "Hz", + "volumetric_flow_rate": "l/min" + } + } + }, + "type": "object", + "title": "UnitChoices", + "description": "Unit Choice for the analysis.\n\nWe might not need all of these.\nWe might want to create preset groups of these (eg. MKS, Imperial etc)" + }, + "UploadedFile": { + "properties": { + "cloud_path": { + "type": "string", + "title": "Cloud Path" + }, + "file_name": { + "type": "string", + "title": "File Name" + }, + "file_size": { + "type": "integer", + "title": "File Size" + } + }, + "type": "object", + "required": [ + "cloud_path", + "file_name", + "file_size" + ], + "title": "UploadedFile", + "description": "Upload File Model." + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "VoltageUnit": { + "type": "string", + "enum": [ + "V", + "mV", + "kV" + ], + "title": "VoltageUnit", + "description": "Voltage Unit." + }, + "VolumeUnit": { + "type": "string", + "enum": [ + "m\u00b3", + "mm\u00b3", + "cm\u00b3", + "in\u00b3", + "ft\u00b3", + "yd\u00b3", + "l", + "ml", + "cc" + ], + "title": "VolumeUnit", + "description": "Volume Unit." + }, + "VolumetricFlowRateUnit": { + "type": "string", + "enum": [ + "m\u00b3/s", + "m\u00b3/min", + "l/s", + "l/min" + ], + "title": "VolumetricFlowRateUnit", + "description": "Unit of volumetric flow rate." + }, + "WheelInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "WheelInDB", + "description": "Wheel with Database ID." + }, + "WheelInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + } + }, + "type": "object", + "title": "WheelInput", + "description": "Wheel as a configuration.\n\nThis is what is stored in the database and the class used for creation." + }, + "WheelRollingResistanceConfigs": { + "type": "string", + "enum": [ + "Car on asphalt", + "Car on concrete", + "Car on gravel" + ], + "title": "WheelRollingResistanceConfigs", + "description": "Condition on wheels which affect the rolling resistance coefficient." + } + }, + "securitySchemes": { + "APIKeyHeader": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "servers": [ + { + "url": "/api" + } + ] +} \ No newline at end of file diff --git a/schema/openapi_remote_test.json b/schema/openapi_remote_test.json new file mode 100644 index 00000000..1c49d484 --- /dev/null +++ b/schema/openapi_remote_test.json @@ -0,0 +1,15240 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "ConceptEV-API", + "summary": "API Endpoint documentation for ConceptEV", + "version": "0.2.160" + }, + "paths": { + "/concepts": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Create Concept Check", + "description": "Create with additional checks.", + "operationId": "create_concept_check_concepts_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Concepts" + ], + "summary": "Read By Design Or Design Instance Ids", + "description": "Get from ID.", + "operationId": "read_by_design_or_design_instance_ids_concepts_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{design_instance_id}": { + "get": { + "tags": [ + "Concepts" + ], + "summary": "Read By Design Or Design Instance Ids", + "description": "Get from ID.", + "operationId": "read_by_design_or_design_instance_ids_concepts__design_instance_id__get", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_instance_id", + "in": "path", + "required": true, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{design_identifier}/settings": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Create Or Update Design Instance Settings", + "description": "Create or update Concept settings.", + "operationId": "create_or_update_design_instance_settings_concepts__design_identifier__settings_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Concepts" + ], + "summary": "Get Design Instance Settings", + "description": "Retrieve Concept settings, falling back to defaults if missing or incomplete.", + "operationId": "get_design_instance_settings_concepts__design_identifier__settings_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSettings" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Concepts" + ], + "summary": "Delete Design Instance Settings", + "description": "Delete Concept settings.", + "operationId": "delete_design_instance_settings_concepts__design_identifier__settings_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{design_identifier}/{part_name}": { + "get": { + "tags": [ + "Concepts" + ], + "summary": "List Parts", + "description": "Get the parts of a concept.", + "operationId": "list_parts_concepts__design_identifier___part_name__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Design Identifier" + } + }, + { + "name": "part_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartNames" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "$ref": "#/components/schemas/ComponentInDB" + }, + { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + { + "$ref": "#/components/schemas/Requirement" + }, + { + "$ref": "#/components/schemas/DriveCycleInDB" + } + ] + } + }, + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "$ref": "#/components/schemas/ComponentInDB" + }, + { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + { + "$ref": "#/components/schemas/Requirement" + }, + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "type": "null" + } + ], + "title": "Response List Parts Concepts Design Identifier Part Name Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts/{item_id}": { + "patch": { + "tags": [ + "Concepts" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_concepts__item_id__patch", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Concepts" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_concepts__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:copy": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Copy", + "description": "Clone Concept.", + "operationId": "copy_concepts_copy_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "populated", + "in": "query", + "required": true, + "schema": { + "type": "boolean", + "title": "Populated" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptCloneInput" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConceptPopulated" + }, + { + "$ref": "#/components/schemas/Concept" + } + ], + "discriminator": { + "propertyName": "concept_type", + "mapping": { + "populated": "#/components/schemas/ConceptPopulated", + "not populated": "#/components/schemas/Concept" + } + }, + "title": "Response Copy Concepts Copy Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:export": { + "get": { + "tags": [ + "Concepts" + ], + "summary": "Export Concept", + "description": "Export Concept to Exchange File.", + "operationId": "export_concept_concepts_export_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "get_jobs", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": false, + "title": "Get Jobs" + } + }, + { + "name": "get_s3_files", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Get S3 Files" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeFile" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/concepts:import": { + "post": { + "tags": [ + "Concepts" + ], + "summary": "Import Concept", + "description": "Import Concept from Exchange File.", + "operationId": "import_concept_concepts_import_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Design Id" + } + }, + { + "name": "project_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Project Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_import_concept_concepts_import_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Concept" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations": { + "post": { + "tags": [ + "Configurations" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_configurations_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + }, + "title": "Configuration" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations/{item_id}": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_configurations__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Configurations" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_configurations__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + }, + "title": "Configuration" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Configurations" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_configurations__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/configurations:calculate_forces": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Calculate Total Forces", + "description": "Calculate the total tractive torque.", + "operationId": "calculate_total_forces_configurations_calculate_forces_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "aero_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Aero Id" + } + }, + { + "name": "mass_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Mass Id" + } + }, + { + "name": "wheel_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Wheel Id" + } + }, + { + "name": "max_speed", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 40, + "title": "Max Speed" + } + }, + { + "name": "acceleration", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Acceleration" + } + }, + { + "name": "altitude", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Altitude" + } + }, + { + "name": "headwind", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Headwind" + } + }, + { + "name": "gradient", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0, + "title": "Gradient" + } + }, + { + "name": "step_size_speed", + "in": "query", + "required": false, + "schema": { + "type": "number", + "default": 0.2, + "title": "Step Size Speed" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraph" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_components_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "title": "Component" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:upload_file": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create Component Data From File", + "description": "Create component part from uploaded file.", + "operationId": "create_component_data_from_file_components_upload_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "file_parameters", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileParameters" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_component_data_from_file_components_upload_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:upload": { + "post": { + "tags": [ + "Components" + ], + "summary": "Create File Items", + "description": "Create component from uploaded file.\n\nReturns the created file item ID and any extracted data needed by the UI in a dict.", + "operationId": "create_file_items_components_upload_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_file_type", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ComponentFileType" + } + }, + { + "name": "return_speed_only", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Return Speed Only" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_file_items_components_upload_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "anyOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "number" + } + ] + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Create File Items Components Upload Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:thermal_model": { + "post": { + "tags": [ + "Components" + ], + "summary": "Add Thermal Model", + "description": "Add a thermal model to an existing file item e.g. MotorLabDataInDB.\n\nCurrently only works for legacy components with data in DB, need to implement for\nS3 as well.", + "operationId": "add_thermal_model_components_thermal_model_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_add_thermal_model_components_thermal_model_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThermalModelDetails" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components/{item_id}": { + "get": { + "tags": [ + "Components" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_components__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Components" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_components__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + }, + "title": "Component" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComponentInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Components" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_components__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:get_display_data": { + "post": { + "tags": [ + "Components" + ], + "summary": "Calc Display Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_display_data_components_get_display_data_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Component Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/components:image_data": { + "post": { + "tags": [ + "Components" + ], + "summary": "Calc Image Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_image_data_components_image_data_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "component_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Component Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures": { + "post": { + "tags": [ + "Architectures" + ], + "summary": "Create Architectures", + "description": "Create architecture from different inputs types.", + "operationId": "create_architectures_architectures_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures/{item_id}": { + "get": { + "tags": [ + "Architectures" + ], + "summary": "Read Architecture", + "description": "Get Architecture from ID.", + "operationId": "read_architecture_architectures__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Architectures" + ], + "summary": "Update Architecture", + "description": "Update Architecture with new Architecture.", + "operationId": "update_architecture_architectures__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArchitectureInputIds" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Architectures" + ], + "summary": "Delete Architecture", + "description": "Delete architecture by ID.", + "operationId": "delete_architecture_architectures__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/architectures:max_speed": { + "get": { + "tags": [ + "Architectures" + ], + "summary": "Get Architecture Max Speed", + "description": "Get the max linear speed of the architecture from component bounds.", + "operationId": "get_architecture_max_speed_architectures_max_speed_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "wheel_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Wheel Id" + } + }, + { + "name": "architecture_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Architecture Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "number", + "title": "Response Get Architecture Max Speed Architectures Max Speed Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_drive_cycles_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "title": "Drive Cycle" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "$ref": "#/components/schemas/DriveCycleS3InDB" + } + ], + "title": "Response Create Drive Cycles Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles/{item_id}": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_drive_cycles__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Response Read Drive Cycles Item Id Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Drive Cycles" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_drive_cycles__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Drive Cycle" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Drive Cycles" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_drive_cycles__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:names": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "List Drive Cycle Names", + "description": "Get a dict of drive cycle names by ID.", + "operationId": "list_drive_cycle_names_drive_cycles_names_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response List Drive Cycle Names Drive Cycles Names Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:data": { + "get": { + "tags": [ + "Drive Cycles" + ], + "summary": "List Drive Cycle Data", + "description": "Get a list of drive cycle data dicts.", + "operationId": "list_drive_cycle_data_drive_cycles_data_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + }, + "title": "Response List Drive Cycle Data Drive Cycles Data Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:from_file": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Create From File", + "description": "Create a requirement from file.\n\nIt can be quite difficult to add anything else to this:\nhttps://stackoverflow.com/questions/65504438/how-to-add-both-file-and-json-body-in-a-fastapi-post-request", + "operationId": "create_from_file_drive_cycles_from_file_post", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "drive_cycle_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Drive Cycle Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_from_file_drive_cycles_from_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleInDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:upload_file": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Upload Drive Cycle File", + "description": "Create job for a drive cycle initial processing.", + "operationId": "upload_drive_cycle_file_drive_cycles_upload_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "file_parameters", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileParameters" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_upload_drive_cycle_file_drive_cycles_upload_file_post" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:standard_drive_cycle": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Get Standard Drive Cycle", + "description": "Get pre-defined drive cycle.", + "operationId": "get_standard_drive_cycle_drive_cycles_standard_drive_cycle_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "standard_drive_cycle", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/StandardDriveCycles" + } + }, + { + "name": "hpc_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Hpc Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycleS3InDB" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/drive_cycles:image_data": { + "post": { + "tags": [ + "Drive Cycles" + ], + "summary": "Calc Image Data", + "description": "Calculate component data from an ID.", + "operationId": "calc_image_data_drive_cycles_image_data_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "drive_cycle_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DriveCycle" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/requirements": { + "post": { + "tags": [ + "Requirements" + ], + "summary": "Create", + "description": "Create from parameters.", + "operationId": "create_requirements_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/requirements/{item_id}": { + "get": { + "tags": [ + "Requirements" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_requirements__item_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "Requirements" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_requirements__item_id__put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requirement" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Requirements" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_requirements__item_id__delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:validate": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Validate Requirement Job", + "description": "Checks if job requirements are valid.", + "operationId": "validate_requirement_job_jobs_validate_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Create Requirement Job", + "description": "Create job for a requirement and architecture.", + "operationId": "create_requirement_job_jobs_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Job" + }, + { + "$ref": "#/components/schemas/UploadedFile" + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Create Requirement Job Jobs Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Jobs" + ], + "summary": "Delete Job Endpoint", + "description": "Delete Job from Concept.", + "operationId": "delete_job_endpoint_jobs_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:start": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Start Job", + "description": "Start a job.", + "operationId": "start_job_jobs_start_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStart" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:status": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Status", + "description": "Request status of job.", + "operationId": "request_status_jobs_status_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStatus" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:result": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Result", + "description": "Get result.", + "operationId": "request_result_jobs_result_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "results_file_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Results File Name" + } + }, + { + "name": "calculate_units", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Calculate Units" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RequirementsSolved" + }, + "title": "Response Request Result Jobs Result Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:error_file": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Request Console Log", + "description": "Get contents of console.log.", + "operationId": "request_console_log_jobs_error_file_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "string", + "title": "Response Request Console Log Jobs Error File Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/jobs:data_compatibility_conversion": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Update Results File Data Format", + "description": "Update the data format of a results file form the HPC.", + "operationId": "update_results_file_data_format_jobs_data_compatibility_conversion_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "results_file_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Results File Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmittedJob" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadedFile" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library:from_id": { + "post": { + "tags": [ + "Library" + ], + "summary": "Add To Library", + "description": "Upload a config or component to the library from the db.", + "operationId": "add_to_library_library_from_id_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "item_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "product_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Product Id" + } + }, + { + "name": "description", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Description" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "component": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + "config": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + } + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Add To Library Library From Id Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library:direct_upload": { + "post": { + "tags": [ + "Library" + ], + "summary": "Add To Library Direct", + "description": "Upload a config or component directly to the library.", + "operationId": "add_to_library_direct_library_direct_upload_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "product_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Product Id" + } + }, + { + "name": "description", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Description" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "component": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + "config": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + }, + "title": "Item" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "prefixItems": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycle" + }, + { + "$ref": "#/components/schemas/ItemAndBlobs" + } + ], + "discriminator": { + "propertyName": "item_type", + "mapping": { + "component": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltages" + }, + { + "$ref": "#/components/schemas/BatteryLookupTable" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurves" + }, + { + "$ref": "#/components/schemas/MotorLossMap" + }, + { + "$ref": "#/components/schemas/MotorLab" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficients" + }, + { + "$ref": "#/components/schemas/TransmissionLossMap" + }, + { + "$ref": "#/components/schemas/TransmissionNeglect" + }, + { + "$ref": "#/components/schemas/InverterAnalytical" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInput" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltages", + "BatteryLookupData": "#/components/schemas/BatteryLookupTable", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurves", + "MotorLossMap": "#/components/schemas/MotorLossMap", + "MotorLabModel": "#/components/schemas/MotorLab", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficients", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMap", + "TransmissionNeglect": "#/components/schemas/TransmissionNeglect", + "InverterAnalytical": "#/components/schemas/InverterAnalytical", + "ClutchInput": "#/components/schemas/DisconnectClutchInput", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID" + } + } + }, + "config": { + "oneOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "$ref": "#/components/schemas/Mass" + }, + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "$ref": "#/components/schemas/AncillaryLoad" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/Aero", + "mass": "#/components/schemas/Mass", + "wheel": "#/components/schemas/WheelInput", + "deceleration_limit": "#/components/schemas/DecelerationLimit", + "ancillary_load": "#/components/schemas/AncillaryLoad" + } + } + }, + "drive_cycle": "#/components/schemas/DriveCycle", + "item_and_blobs": "#/components/schemas/ItemAndBlobs" + } + } + } + ], + "minItems": 2, + "maxItems": 2, + "title": "Response Add To Library Direct Library Direct Upload Post" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/library/{object_id}": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get From Library", + "description": "Download item from library and convert to user units.\n\nReturn as a dictionary with the id removed. Note that the object id and blob id are\nidentical so can just download directly from the blob API.", + "operationId": "get_from_library_library__object_id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response Get From Library Library Object Id Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/unit_choices": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_unit_choices_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "put": { + "tags": [ + "Unit Choices" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_unit_choices_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "post": { + "tags": [ + "Unit Choices" + ], + "summary": "Create Unit Choices", + "description": "Create.", + "operationId": "create_unit_choices_unit_choices_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "delete": { + "tags": [ + "Unit Choices" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_unit_choices_delete", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/unit_choices/info": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Get Info", + "description": "Get table of units for frontend generation.", + "operationId": "get_info_unit_choices_info_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Get Info Unit Choices Info Get" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/templates": { + "post": { + "tags": [ + "templates" + ], + "summary": "Add To Templates", + "description": "Restricted to template creators.", + "operationId": "add_to_templates_templates_post", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "template_name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Template Name" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + }, + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "templates" + ], + "summary": "Update", + "description": "Restricted to template creators.", + "operationId": "update_templates_put", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "templates" + ], + "summary": "Remove From Templates", + "description": "Restricted to template creators.", + "operationId": "remove_from_templates_templates_delete", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "template_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Template Id" + } + }, + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/templates/list": { + "get": { + "tags": [ + "templates" + ], + "summary": "List Templates", + "description": "List Templates. Get name from the design name.", + "operationId": "list_templates_templates_list_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Template" + }, + "title": "Response List Templates Templates List Get" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/utilities:data_format_version": { + "get": { + "tags": [ + "Utilities" + ], + "summary": "Get Data Format Version Number", + "description": "Return the latest solver data format version.", + "operationId": "get_data_format_version_number_utilities_data_format_version_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "integer", + "title": "Response Get Data Format Version Number Utilities Data Format Version Get" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/version": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Version", + "description": "API Version.", + "operationId": "version_version_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Version Version Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/stage": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Stage", + "description": "What stage of cloud services the API is using, dev/test/prod.", + "operationId": "stage_stage_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "string", + "title": "Response Stage Stage Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/health": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Health Check", + "description": "Health Check.", + "operationId": "health_check_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Health Check Health Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/readiness": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Readiness Check", + "description": "Health Check.", + "operationId": "readiness_check_readiness_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/authenticated_token": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Token", + "description": "Authenticated Token.", + "operationId": "authenticated_token_authenticated_token_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/authenticated_user": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated User", + "description": "Authenticated User.", + "operationId": "authenticated_user_authenticated_user_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/authenticated_design_identifier": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Design Identifier", + "description": "Authenticated Design Instance.", + "operationId": "authenticated_design_identifier_authenticated_design_identifier_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "design_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + { + "name": "design_instance_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/authenticated_access": { + "get": { + "tags": [ + "System Status" + ], + "summary": "Authenticated Product", + "description": "Authenticated Design Instance.", + "operationId": "authenticated_product_authenticated_access_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Account Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AccelerationUnit": { + "type": "string", + "enum": [ + "m/s\u00b2", + "km/hr/s", + "mph/s" + ], + "title": "AccelerationUnit", + "description": "Acceleration Unit." + }, + "Aero": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + } + }, + "type": "object", + "title": "Aero", + "description": "Aero Configuration." + }, + "AeroInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "AeroInDB", + "description": "Aero configs with Database ID." + }, + "AncillaryLoad": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Ancillary Load" + }, + "load_stationary": { + "type": "number", + "title": "Load Stationary", + "default": 1000 + }, + "load_moving": { + "type": "number", + "title": "Load Moving", + "default": 1000 + }, + "config_type": { + "type": "string", + "const": "ancillary_load", + "title": "Config Type", + "default": "ancillary_load" + } + }, + "type": "object", + "title": "AncillaryLoad", + "description": "Ancillary Load Configuration." + }, + "AncillaryLoadInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Ancillary Load" + }, + "load_stationary": { + "type": "number", + "title": "Load Stationary", + "default": 1000 + }, + "load_moving": { + "type": "number", + "title": "Load Moving", + "default": 1000 + }, + "config_type": { + "type": "string", + "const": "ancillary_load", + "title": "Config Type", + "default": "ancillary_load" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "AncillaryLoadInDB", + "description": "Ancillary load with Database ID." + }, + "AngleUnit": { + "type": "string", + "enum": [ + "rad", + "deg", + "%" + ], + "title": "AngleUnit", + "description": "Unit of Angle." + }, + "AngularAccelerationUnit": { + "type": "string", + "enum": [ + "rad/s\u00b2", + "rpm/s", + "rps/s", + "deg/s\u00b2" + ], + "title": "AngularAccelerationUnit", + "description": "Angular Acceleration Unit." + }, + "AngularSpeedUnit": { + "type": "string", + "enum": [ + "rad/s", + "rpm", + "rps", + "deg/s" + ], + "title": "AngularSpeedUnit", + "description": "Angular Speed Unit." + }, + "ArchitectureInputIds": { + "properties": { + "_id": { + "type": "string", + "title": "Id" + }, + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "components_cost": { + "type": "number", + "title": "Components Cost", + "default": 0 + }, + "components_mass": { + "type": "number", + "title": "Components Mass", + "default": 0 + }, + "max_wheel_speed": { + "type": "number", + "title": "Max Wheel Speed", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels" + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + } + }, + "type": "object", + "required": [ + "number_of_front_wheels", + "number_of_front_motors", + "number_of_rear_wheels", + "number_of_rear_motors", + "battery_id" + ], + "title": "ArchitectureInputIds", + "description": "Base class for architecture ID classes.\n\nMutable so we can calculate component masses and costs." + }, + "ArchitectureOutline": { + "properties": { + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 0 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 0 + } + }, + "type": "object", + "title": "ArchitectureOutline", + "description": "Outline of an architecture returned in solved requirements." + }, + "AreaUnit": { + "type": "string", + "enum": [ + "m\u00b2", + "mm\u00b2", + "cm\u00b2", + "in\u00b2", + "ft\u00b2", + "yd\u00b2" + ], + "title": "AreaUnit", + "description": "Area Unit." + }, + "BatteryConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "battery", + "title": "Component Config Type", + "default": "battery" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryConfiguration", + "description": "Configuration that can change characteristics of the battery." + }, + "BatteryFixedVoltages": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryFixedVoltages", + "description": "Input Values for Fixed Voltages Battery." + }, + "BatteryFixedVoltagesInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "BatteryFixedVoltagesInDB", + "description": "Battery in Database." + }, + "BatteryLookupTable": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTable", + "description": "Input values for Battery Model from Lookup Data." + }, + "BatteryLookupTableData": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableData", + "description": "Data for a lookup table battery." + }, + "BatteryLookupTableDataInDB": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableDataInDB", + "description": "Lookup table in Database." + }, + "BatteryLookupTableID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "BatteryLookupTableID", + "title": "Component Type", + "default": "BatteryLookupTableID" + } + }, + "type": "object", + "title": "BatteryLookupTableID", + "description": "Motor Lab with the data referenced by ID." + }, + "BatteryLookupTableInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTableInDB", + "description": "Battery in Database." + }, + "BatteryState": { + "properties": { + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Temperature" + } + }, + "type": "object", + "title": "BatteryState", + "description": "Variables that define state of a battery." + }, + "Blob": { + "properties": { + "blob": { + "type": "string", + "format": "base64", + "contentMediaType": "application/octet-stream", + "title": "Blob" + }, + "job_data": { + "$ref": "#/components/schemas/JobData" + } + }, + "type": "object", + "required": [ + "blob", + "job_data" + ], + "title": "Blob", + "description": "Blob Model." + }, + "Body_add_thermal_model_components_thermal_model_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_add_thermal_model_components_thermal_model_post" + }, + "Body_create_component_data_from_file_components_upload_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_component_data_from_file_components_upload_file_post" + }, + "Body_create_file_items_components_upload_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_file_items_components_upload_post" + }, + "Body_create_from_file_drive_cycles_from_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_from_file_drive_cycles_from_file_post" + }, + "Body_import_concept_concepts_import_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_import_concept_concepts_import_post" + }, + "Body_upload_drive_cycle_file_drive_cycles_upload_file_post": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_upload_drive_cycle_file_drive_cycles_upload_file_post" + }, + "CapabilityCurve": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques" + }, + "powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Powers" + }, + "accelerations": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Accelerations", + "default": [] + }, + "motor_splits": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Motor Splits" + }, + "motor_names": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Motor Names" + }, + "errors": { + "additionalProperties": true, + "type": "object", + "title": "Errors", + "default": {} + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "powers", + "motor_splits", + "motor_names" + ], + "title": "CapabilityCurve", + "description": "Data to plot a capability curve." + }, + "CevJobStatus": { + "type": "string", + "enum": [ + "MIGRATED", + "NOT_MIGRATED" + ], + "title": "CevJobStatus", + "description": "CEV Job Status." + }, + "ComponentAxle": { + "type": "string", + "enum": [ + "Front", + "Rear", + "None" + ], + "title": "ComponentAxle", + "description": "Component axle." + }, + "ComponentConfigurationSet": { + "properties": { + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Configurations" + } + }, + "type": "object", + "title": "ComponentConfigurationSet", + "description": "Set of component configurations." + }, + "ComponentData": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLossMapDataInDB" + }, + { + "$ref": "#/components/schemas/MotorLabDataInDB" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesDataInDB" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableDataInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapDataInDB" + }, + { + "$ref": "#/components/schemas/InverterLossMapDataInDB" + } + ], + "title": "ComponentData", + "description": "Data that is used as a property of some components.", + "discriminator": { + "propertyName": "component_file_type", + "mapping": { + "BatteryLookupTable": "#/components/schemas/BatteryLookupTableDataInDB", + "InverterLossMap": "#/components/schemas/InverterLossMapDataInDB", + "MotorLab": "#/components/schemas/MotorLabDataInDB", + "MotorLossMap": "#/components/schemas/MotorLossMapDataInDB", + "MotorTorqueCurve": "#/components/schemas/MotorTorqueCurvesDataInDB", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMapDataInDB" + } + } + }, + "ComponentFileType": { + "type": "string", + "enum": [ + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "transmission_torque_grid_file", + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "thermal_model_file" + ], + "title": "ComponentFileType", + "description": "Types of files." + }, + "ComponentInDB": { + "oneOf": [ + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInDB" + }, + { + "$ref": "#/components/schemas/DisconnectClutchInputInDB" + }, + { + "$ref": "#/components/schemas/InverterAnalyticalInDB" + }, + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInDB" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesInDB" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapInDB" + }, + { + "$ref": "#/components/schemas/MotorLabInDB" + }, + { + "$ref": "#/components/schemas/MotorLossMapInDB" + } + ], + "title": "ComponentInDB", + "description": "A way to get the actual component from the Union.\n\nUse ComponentInDB().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-functions", + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInDB", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInDB", + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "ClutchInput": "#/components/schemas/DisconnectClutchInputInDB", + "InverterAnalytical": "#/components/schemas/InverterAnalyticalInDB", + "InverterLossMapID": "#/components/schemas/InverterLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorLabModel": "#/components/schemas/MotorLabInDB", + "MotorLossMap": "#/components/schemas/MotorLossMapInDB", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "MotorTorqueCurves": "#/components/schemas/MotorTorqueCurvesInDB", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInDB", + "TransmissionLossMap": "#/components/schemas/TransmissionLossMapInDB", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID" + } + } + }, + "ComponentLossMapArgs": { + "properties": { + "voltage": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage" + }, + "gear_ratio": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Gear Ratio" + }, + "speed": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Speed" + }, + "dc_current": { + "type": "number", + "title": "Dc Current", + "default": 50 + }, + "power_factor": { + "type": "number", + "title": "Power Factor", + "default": 1 + }, + "phase_current_max": { + "type": "number", + "title": "Phase Current Max", + "default": 400 + }, + "frequency": { + "type": "number", + "title": "Frequency", + "default": 1000 + } + }, + "type": "object", + "title": "ComponentLossMapArgs", + "description": "Args for create component loss maps.\n\nAllows unit transforming." + }, + "ComponentSide": { + "type": "string", + "enum": [ + "Left", + "Right", + "None" + ], + "title": "ComponentSide", + "description": "Component side." + }, + "Concept": { + "properties": { + "concept_type": { + "type": "string", + "const": "not populated", + "title": "Concept Type", + "default": "not populated" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "type": "string", + "title": "User Id" + }, + "project_id": { + "type": "string", + "title": "Project Id" + }, + "design_id": { + "type": "string", + "title": "Design Id" + }, + "design_instance_id": { + "type": "string", + "title": "Design Instance Id" + }, + "architecture_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Architecture Id" + }, + "components_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Components Ids" + }, + "configurations_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Configurations Ids" + }, + "requirements_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirements Ids" + }, + "jobs_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Jobs Ids" + }, + "capabilities_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Capabilities Ids" + }, + "drive_cycles_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Drive Cycles Ids" + }, + "file_items_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Items Ids", + "default": [] + }, + "concept_settings_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Concept Settings Id" + } + }, + "type": "object", + "required": [ + "user_id", + "project_id", + "design_id", + "design_instance_id", + "components_ids", + "configurations_ids", + "requirements_ids", + "jobs_ids", + "capabilities_ids", + "drive_cycles_ids" + ], + "title": "Concept", + "description": "Concept." + }, + "ConceptCloneInput": { + "properties": { + "old_design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Old Design Instance Id" + }, + "old_design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Old Design Id" + }, + "copy_jobs": { + "type": "boolean", + "title": "Copy Jobs" + }, + "new_design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "New Design Instance Id" + }, + "new_design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "New Design Id" + } + }, + "type": "object", + "required": [ + "copy_jobs" + ], + "title": "ConceptCloneInput", + "description": "Inputs needed to clone/copy a concept." + }, + "ConceptPopulated": { + "properties": { + "concept_type": { + "type": "string", + "const": "populated", + "title": "Concept Type", + "default": "populated" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "type": "string", + "title": "User Id" + }, + "project_id": { + "type": "string", + "title": "Project Id" + }, + "design_id": { + "type": "string", + "title": "Design Id" + }, + "design_instance_id": { + "type": "string", + "title": "Design Instance Id" + }, + "architecture_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Architecture Id" + }, + "components_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Components Ids" + }, + "configurations_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Configurations Ids" + }, + "requirements_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirements Ids" + }, + "jobs_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Jobs Ids" + }, + "capabilities_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Capabilities Ids" + }, + "drive_cycles_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Drive Cycles Ids" + }, + "file_items_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Items Ids", + "default": [] + }, + "concept_settings_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Concept Settings Id" + }, + "architecture": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArchitectureInputIds" + }, + { + "type": "null" + } + ] + }, + "components": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ComponentInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Components" + }, + "configurations": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ConfigurationInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Configurations" + }, + "requirements": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Requirement" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Requirements" + }, + "jobs": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/JobData" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Jobs" + }, + "drive_cycles": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/DriveCycleInDB" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Drive Cycles" + }, + "file_items": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ComponentData" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "File Items" + }, + "concept_settings": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConceptSettings" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "user_id", + "project_id", + "design_id", + "design_instance_id", + "components_ids", + "configurations_ids", + "requirements_ids", + "jobs_ids", + "capabilities_ids", + "drive_cycles_ids" + ], + "title": "ConceptPopulated", + "description": "Expanded class with populated members." + }, + "ConceptSettings": { + "properties": { + "calculate_inertia": { + "type": "boolean", + "title": "Calculate Inertia", + "default": true + } + }, + "type": "object", + "title": "ConceptSettings", + "description": "Concept Settings Base Model." + }, + "ConceptUpdate": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + } + }, + "type": "object", + "title": "ConceptUpdate", + "description": "Concept Updating Object." + }, + "ConfigurationInDB": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInDB" + }, + { + "$ref": "#/components/schemas/MassInDB" + }, + { + "$ref": "#/components/schemas/WheelInDB" + }, + { + "$ref": "#/components/schemas/DecelerationLimitInDB" + }, + { + "$ref": "#/components/schemas/AncillaryLoadInDB" + } + ], + "title": "ConfigurationInDB", + "description": "A way to get the actual config from the Union.\n\nUse ConfigurationInDB().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInDB", + "ancillary_load": "#/components/schemas/AncillaryLoadInDB", + "deceleration_limit": "#/components/schemas/DecelerationLimitInDB", + "mass": "#/components/schemas/MassInDB", + "wheel": "#/components/schemas/WheelInDB" + } + } + }, + "CurrentUnit": { + "type": "string", + "enum": [ + "A", + "mA", + "kA" + ], + "title": "CurrentUnit", + "description": "Current Unit." + }, + "DecelerationLimit": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Deceleration Limit" + }, + "limit": { + "type": "number", + "title": "Limit", + "default": -3.92 + }, + "config_type": { + "type": "string", + "const": "deceleration_limit", + "title": "Config Type", + "default": "deceleration_limit" + } + }, + "type": "object", + "title": "DecelerationLimit", + "description": "Deceleration Limit Configuration." + }, + "DecelerationLimitInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Deceleration Limit" + }, + "limit": { + "type": "number", + "title": "Limit", + "default": -3.92 + }, + "config_type": { + "type": "string", + "const": "deceleration_limit", + "title": "Config Type", + "default": "deceleration_limit" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DecelerationLimitInDB", + "description": "Deceleration limit with Database ID." + }, + "DensityUnit": { + "type": "string", + "enum": [ + "kg/m\u00b3", + "g/cm\u00b3" + ], + "title": "DensityUnit", + "description": "Density Unit." + }, + "DisconnectClutchInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Disconnect Clutch" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "ClutchInput", + "title": "Component Type", + "default": "ClutchInput" + }, + "efficiency": { + "type": "number", + "title": "Efficiency", + "default": 1 + } + }, + "type": "object", + "title": "DisconnectClutchInput", + "description": "Disconnect clutch input." + }, + "DisconnectClutchInputInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Disconnect Clutch" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "ClutchInput", + "title": "Component Type", + "default": "ClutchInput" + }, + "efficiency": { + "type": "number", + "title": "Efficiency", + "default": 1 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DisconnectClutchInputInDB", + "description": "Disconnect clutch In DB." + }, + "DriveCycle": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + } + }, + "type": "object", + "title": "DriveCycle", + "description": "Drive Cycle." + }, + "DriveCycleInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "DriveCycleInDB", + "description": "Drive Cycle in Database." + }, + "DriveCycleRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "$ref": "#/components/schemas/DriveCycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + } + }, + "type": "object", + "required": [ + "drive_cycle" + ], + "title": "DriveCycleRequirement", + "description": "Drive Cycle Requirement Populated From Database." + }, + "DriveCycleRequirementIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Drive Cycle Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + }, + "starting_state_of_charge": { + "type": "number", + "title": "Starting State Of Charge", + "default": 1 + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementIds", + "description": "Drive Cycle Requirement ID linked." + }, + "DriveCycleS3": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + } + }, + "type": "object", + "required": [ + "submitted_job" + ], + "title": "DriveCycleS3", + "description": "Drive Cycle S3." + }, + "DriveCycleS3InDB": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "submitted_job" + ], + "title": "DriveCycleS3InDB", + "description": "Drive Cycle in Database." + }, + "DriveCycleSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "battery_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Battery Charge" + }, + "time": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Time" + }, + "distance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Distance" + }, + "vehicle_range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Vehicle Range" + }, + "efficiency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Efficiency" + }, + "total_values": { + "$ref": "#/components/schemas/TransientTotalValues" + }, + "requirement_solved_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Solved Type", + "default": "drive_cycle" + }, + "drive_cycle_requirement": { + "$ref": "#/components/schemas/DriveCycleRequirement" + }, + "torques_achieved": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques Achieved" + }, + "torques_drive_cycle": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques Drive Cycle" + }, + "points_achieved_ratio": { + "type": "number", + "title": "Points Achieved Ratio", + "default": 1.0 + }, + "points_not_achieved": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Points Not Achieved", + "default": [] + }, + "warnings": { + "additionalProperties": true, + "type": "object", + "title": "Warnings", + "default": {} + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "time", + "distance", + "drive_cycle_requirement", + "torques_achieved", + "torques_drive_cycle" + ], + "title": "DriveCycleSolved", + "description": "Solution to Drive Cycle given to APP." + }, + "DynamicRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + }, + "base_speed": { + "type": "number", + "title": "Base Speed" + }, + "end_time": { + "type": "number", + "title": "End Time" + }, + "end_distance": { + "type": "number", + "title": "End Distance" + }, + "points": { + "items": { + "$ref": "#/components/schemas/TransientCalculationPoint" + }, + "type": "array", + "title": "Points" + }, + "voltage_oc": { + "type": "number", + "title": "Voltage Oc" + }, + "requirement_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "base_speed", + "end_time", + "end_distance", + "points", + "voltage_oc" + ], + "title": "DynamicRequirement", + "description": "Dynamic Requirements." + }, + "DynamicRequirementInputsIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Dynamic Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "dynamic_input", + "title": "Requirement Type", + "default": "dynamic_input" + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 27.77777777777778 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 5 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": true + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementInputsIds", + "description": "Dynamic Requirement Inputs ID linked." + }, + "DynamicRequirementSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "battery_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Battery Charge" + }, + "time": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Time" + }, + "distance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Distance" + }, + "vehicle_range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Vehicle Range" + }, + "efficiency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Efficiency" + }, + "total_values": { + "$ref": "#/components/schemas/TransientTotalValues" + }, + "requirement_solved_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Solved Type", + "default": "dynamic" + }, + "requirement": { + "$ref": "#/components/schemas/DynamicRequirement" + }, + "requirements": { + "items": { + "$ref": "#/components/schemas/StaticRequirement" + }, + "type": "array", + "title": "Requirements" + }, + "traction_limits": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/StaticRequirement" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Traction Limits" + }, + "capability_curve": { + "anyOf": [ + { + "$ref": "#/components/schemas/CapabilityCurve" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Error Code" + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "time", + "distance", + "requirement", + "requirements", + "traction_limits", + "capability_curve" + ], + "title": "DynamicRequirementSolved", + "description": "Solution to dynamic requirement given to APP." + }, + "ElectricChargeUnit": { + "type": "string", + "enum": [ + "A\u00b7s" + ], + "title": "ElectricChargeUnit", + "description": "Unit of Electrical Charge." + }, + "ElectricalEnergyUnit": { + "type": "string", + "enum": [ + "J", + "kWh", + "VA\u00b7hr", + "Wh" + ], + "title": "ElectricalEnergyUnit", + "description": "Unit of Electrical Energy." + }, + "ElectricalPowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "VA", + "kVA" + ], + "title": "ElectricalPowerUnit", + "description": "Unit of Electrical Power." + }, + "EnergyUnit": { + "type": "string", + "enum": [ + "J", + "kJ", + "MJ", + "mJ", + "Wh", + "kWh" + ], + "title": "EnergyUnit", + "description": "Energy Unit." + }, + "ExchangeFile": { + "properties": { + "note": { + "type": "string", + "title": "Note", + "default": "This file format is intended as a transport file\n format and may not remain backwards compatible." + }, + "date_created": { + "type": "string", + "title": "Date Created" + }, + "api_version": { + "type": "string", + "title": "Api Version" + }, + "concept": { + "$ref": "#/components/schemas/ConceptPopulated" + }, + "blobs": { + "items": { + "$ref": "#/components/schemas/Blob" + }, + "type": "array", + "title": "Blobs" + } + }, + "type": "object", + "required": [ + "date_created", + "api_version", + "concept", + "blobs" + ], + "title": "ExchangeFile", + "description": "Exchange File Model." + }, + "FileParameters": { + "properties": { + "component_file_type": { + "$ref": "#/components/schemas/ComponentFileType" + }, + "hpc_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Hpc Id", + "deprecated": true + }, + "file_hash": { + "type": "string", + "title": "File Hash" + }, + "file_size": { + "type": "integer", + "title": "File Size" + }, + "account_id": { + "type": "string", + "title": "Account Id" + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag", + "default": "latest" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + "type": "object", + "required": [ + "component_file_type", + "file_hash", + "file_size", + "account_id" + ], + "title": "FileParameters", + "description": "File Parameters." + }, + "ForceUnit": { + "type": "string", + "enum": [ + "N", + "lbf", + "dyn" + ], + "title": "ForceUnit", + "description": "Force Unit." + }, + "FrequencyUnit": { + "type": "string", + "enum": [ + "Hz" + ], + "title": "FrequencyUnit", + "description": "Unit of frequency." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InertiaUnit": { + "type": "string", + "enum": [ + "kg\u00b7m\u00b2", + "g\u00b7mm\u00b2" + ], + "title": "InertiaUnit", + "description": "Inertia Unit." + }, + "InverterAnalytical": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Analytical Inverter" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "InverterAnalytical", + "title": "Component Type", + "default": "InverterAnalytical" + }, + "inverter_data": { + "oneOf": [ + { + "$ref": "#/components/schemas/InverterSimpleData" + }, + { + "$ref": "#/components/schemas/InverterIGBTData" + }, + { + "$ref": "#/components/schemas/InverterMOSFETData" + } + ], + "title": "Inverter Data", + "discriminator": { + "propertyName": "inverter_type", + "mapping": { + "IGBT": "#/components/schemas/InverterIGBTData", + "MOSFET": "#/components/schemas/InverterMOSFETData", + "simple": "#/components/schemas/InverterSimpleData" + } + } + }, + "current_limit_rms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Current Limit Rms" + } + }, + "type": "object", + "required": [ + "inverter_data" + ], + "title": "InverterAnalytical", + "description": "Analytical inverter input." + }, + "InverterAnalyticalInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Analytical Inverter" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "InverterAnalytical", + "title": "Component Type", + "default": "InverterAnalytical" + }, + "inverter_data": { + "oneOf": [ + { + "$ref": "#/components/schemas/InverterSimpleData" + }, + { + "$ref": "#/components/schemas/InverterIGBTData" + }, + { + "$ref": "#/components/schemas/InverterMOSFETData" + } + ], + "title": "Inverter Data", + "discriminator": { + "propertyName": "inverter_type", + "mapping": { + "IGBT": "#/components/schemas/InverterIGBTData", + "MOSFET": "#/components/schemas/InverterMOSFETData", + "simple": "#/components/schemas/InverterSimpleData" + } + } + }, + "current_limit_rms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Current Limit Rms" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "inverter_data" + ], + "title": "InverterAnalyticalInDB", + "description": "Inverter model in DB." + }, + "InverterIGBTData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "switching_energy_on": { + "type": "number", + "title": "Switching Energy On", + "default": 0.112 + }, + "switching_energy_off": { + "type": "number", + "title": "Switching Energy Off", + "default": 0.09 + }, + "switching_energy_reverse": { + "type": "number", + "title": "Switching Energy Reverse", + "default": 0.036 + }, + "voltage_ref": { + "type": "number", + "title": "Voltage Ref", + "default": 600 + }, + "current_ref": { + "type": "number", + "title": "Current Ref", + "default": 800 + }, + "pwm_frequency": { + "type": "number", + "title": "Pwm Frequency", + "default": 20000 + }, + "pwm_ratio": { + "type": "number", + "title": "Pwm Ratio", + "default": 1 + }, + "pwm_definition": { + "$ref": "#/components/schemas/PWMFrequencyDefinition", + "default": 1 + }, + "diode_voltage_drop": { + "type": "number", + "title": "Diode Voltage Drop", + "default": 1 + }, + "diode_dynamic_resistance": { + "type": "number", + "title": "Diode Dynamic Resistance", + "default": 0.00222 + }, + "transistor_voltage_drop": { + "type": "number", + "title": "Transistor Voltage Drop", + "default": 0.85 + }, + "transistor_dynamic_resistance": { + "type": "number", + "title": "Transistor Dynamic Resistance", + "default": 0.00094 + }, + "inverter_type": { + "type": "string", + "const": "IGBT", + "title": "Inverter Type", + "default": "IGBT" + } + }, + "type": "object", + "title": "InverterIGBTData", + "description": "Wrapper for inverter IGBT model to handle units and default values." + }, + "InverterLossMapDataInDB": { + "properties": { + "phase_currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Phase Currents" + }, + "dc_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Dc Voltages" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "voltage_drops": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Voltage Drops" + }, + "bounds": { + "type": "null", + "title": "Bounds" + }, + "component_file_type": { + "type": "string", + "const": "InverterLossMap", + "title": "Component File Type", + "default": "InverterLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "phase_currents", + "dc_voltages", + "losses", + "voltage_drops" + ], + "title": "InverterLossMapDataInDB", + "description": "Loss Map in Database." + }, + "InverterLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "InverterLossMapID", + "title": "Component Type", + "default": "InverterLossMapID" + }, + "alternative_voltage_drop": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Alternative Voltage Drop" + } + }, + "type": "object", + "title": "InverterLossMapID", + "description": "Inverter Loss Map ID." + }, + "InverterMOSFETData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "switching_energy_on": { + "type": "number", + "title": "Switching Energy On", + "default": 0.021 + }, + "switching_energy_off": { + "type": "number", + "title": "Switching Energy Off", + "default": 0.018 + }, + "switching_energy_reverse": { + "type": "number", + "title": "Switching Energy Reverse", + "default": 0.004 + }, + "voltage_ref": { + "type": "number", + "title": "Voltage Ref", + "default": 600 + }, + "current_ref": { + "type": "number", + "title": "Current Ref", + "default": 800 + }, + "pwm_frequency": { + "type": "number", + "title": "Pwm Frequency", + "default": 20000 + }, + "pwm_ratio": { + "type": "number", + "title": "Pwm Ratio", + "default": 1 + }, + "pwm_definition": { + "$ref": "#/components/schemas/PWMFrequencyDefinition", + "default": 1 + }, + "diode_voltage_drop": { + "type": "number", + "title": "Diode Voltage Drop", + "default": 2.1 + }, + "diode_dynamic_resistance": { + "type": "number", + "title": "Diode Dynamic Resistance", + "default": 0.0018 + }, + "drain_source_on_resistance": { + "type": "number", + "title": "Drain Source On Resistance", + "default": 0.0018 + }, + "inverter_type": { + "type": "string", + "const": "MOSFET", + "title": "Inverter Type", + "default": "MOSFET" + } + }, + "type": "object", + "title": "InverterMOSFETData", + "description": "Wrapper for inverter MOSFET model to handle units and defaults." + }, + "InverterSimpleData": { + "properties": { + "modulation_index": { + "type": "number", + "title": "Modulation Index", + "default": 1.12 + }, + "dc_harness_resistance": { + "type": "number", + "title": "Dc Harness Resistance", + "default": 0.01 + }, + "ac_harness_resistance": { + "type": "number", + "title": "Ac Harness Resistance", + "default": 0.001 + }, + "ac_resistance": { + "type": "number", + "title": "Ac Resistance", + "default": 0 + }, + "dc_resistance": { + "type": "number", + "title": "Dc Resistance", + "default": 0 + }, + "switch_resistance": { + "type": "number", + "title": "Switch Resistance", + "default": 0 + }, + "switch_forward_voltage": { + "type": "number", + "title": "Switch Forward Voltage", + "default": 0 + }, + "switching_time": { + "type": "number", + "title": "Switching Time", + "default": 0 + }, + "switch_per_pwm_period": { + "type": "integer", + "title": "Switch Per Pwm Period", + "default": 0 + }, + "fixed_loss": { + "type": "number", + "title": "Fixed Loss", + "default": 0 + }, + "inverter_type": { + "type": "string", + "const": "simple", + "title": "Inverter Type", + "default": "simple" + } + }, + "type": "object", + "title": "InverterSimpleData", + "description": "Wrapper for inverter simple model to handle units." + }, + "ItemAndBlobs": { + "properties": { + "item_type": { + "type": "string", + "const": "item_and_blobs", + "title": "Item Type", + "default": "item_and_blobs" + }, + "component": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLossMapID" + }, + { + "$ref": "#/components/schemas/MotorLabID" + }, + { + "$ref": "#/components/schemas/MotorTorqueCurvesID" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableID" + }, + { + "$ref": "#/components/schemas/TransmissionLossMapID" + }, + { + "$ref": "#/components/schemas/InverterLossMapID" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryLookupTableID": "#/components/schemas/BatteryLookupTableID", + "InverterLossMapID": "#/components/schemas/InverterLossMapID", + "MotorLabID": "#/components/schemas/MotorLabID", + "MotorLossMapID": "#/components/schemas/MotorLossMapID", + "MotorTorqueCurveID": "#/components/schemas/MotorTorqueCurvesID", + "TransmissionLossMapID": "#/components/schemas/TransmissionLossMapID" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleS3" + } + ], + "title": "Component" + }, + "blobs": { + "items": { + "$ref": "#/components/schemas/Blob" + }, + "type": "array", + "title": "Blobs" + } + }, + "type": "object", + "required": [ + "component", + "blobs" + ], + "title": "ItemAndBlobs", + "description": "Item with blobs.\n\nUsed in the library to detect whether this is item that has associated S3 blobs." + }, + "Job": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "trace_id": { + "type": "string", + "title": "Trace Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "ram_estimate": { + "type": "integer", + "title": "Ram Estimate", + "default": 4000 + }, + "requirements": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Requirements" + } + }, + "type": "object", + "required": [ + "id", + "trace_id", + "name" + ], + "title": "Job", + "description": "Job model." + }, + "JobData": { + "properties": { + "submitted_job": { + "$ref": "#/components/schemas/SubmittedJob" + }, + "date": { + "type": "number", + "title": "Date" + }, + "cev_status": { + "$ref": "#/components/schemas/CevJobStatus" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "encrypted": { + "type": "boolean", + "title": "Encrypted" + } + }, + "type": "object", + "required": [ + "submitted_job", + "date", + "cev_status", + "filename", + "encrypted" + ], + "title": "JobData", + "description": "Job Data." + }, + "JobInput": { + "properties": { + "job_name": { + "type": "string", + "title": "Job Name" + }, + "requirement_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirement Ids" + }, + "architecture_id": { + "type": "string", + "title": "Architecture Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + } + }, + "type": "object", + "required": [ + "job_name", + "requirement_ids", + "architecture_id" + ], + "title": "JobInput", + "description": "Job Input." + }, + "JobStart": { + "properties": { + "job": { + "$ref": "#/components/schemas/Job" + }, + "uploaded_file": { + "$ref": "#/components/schemas/UploadedFile" + }, + "account_id": { + "type": "string", + "title": "Account Id" + }, + "hpc_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Hpc Id", + "deprecated": true + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag", + "default": "default" + }, + "extra_memory": { + "type": "boolean", + "title": "Extra Memory", + "default": false + } + }, + "type": "object", + "required": [ + "job", + "uploaded_file", + "account_id" + ], + "title": "JobStart", + "description": "Job Start." + }, + "JobStatus": { + "properties": { + "status": { + "anyOf": [ + { + "$ref": "#/components/schemas/Statuses" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "JobStatus", + "description": "Status of the Job." + }, + "LengthUnit": { + "type": "string", + "enum": [ + "m", + "mm", + "cm", + "in", + "ft", + "yd", + "km", + "miles" + ], + "title": "LengthUnit", + "description": "Length Unit." + }, + "Mass": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + } + }, + "type": "object", + "title": "Mass", + "description": "Mass Configuration." + }, + "MassInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "MassInDB", + "description": "Mass config with Database ID." + }, + "MassUnit": { + "type": "string", + "enum": [ + "kg", + "g", + "lb", + "oz", + "t", + "LT", + "tn" + ], + "title": "MassUnit", + "description": "Mass Unit." + }, + "MotorConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "motor", + "title": "Component Config Type", + "default": "motor" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "state": { + "$ref": "#/components/schemas/MotorState", + "default": {} + } + }, + "type": "object", + "title": "MotorConfiguration", + "description": "Configuration that can change characteristics of the motor." + }, + "MotorLab": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "$ref": "#/components/schemas/MotorLabData" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + } + }, + "type": "object", + "required": [ + "lab_data", + "max_speed" + ], + "title": "MotorLab", + "description": "Create Motor From Lab Model." + }, + "MotorLabData": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabData", + "description": "Motor Lab Data.\n\nModel is held as a dict, exported from Lab." + }, + "MotorLabDataInDB": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + }, + "_id": { + "type": "string", + "title": "Id" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabDataInDB", + "description": "Lab dictionary in Database.\n\nCan also contain the thermal model." + }, + "MotorLabID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "component_type": { + "type": "string", + "const": "MotorLabID", + "title": "Component Type", + "default": "MotorLabID" + } + }, + "type": "object", + "required": [ + "max_speed" + ], + "title": "MotorLabID", + "description": "Motor Lab with the data referenced by ID." + }, + "MotorLabInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "$ref": "#/components/schemas/MotorLabData" + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModelSolver" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "lab_data", + "max_speed" + ], + "title": "MotorLabInDB", + "description": "Motor in Database." + }, + "MotorLossMap": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component Type", + "default": "MotorLossMap" + }, + "loss_map": { + "$ref": "#/components/schemas/MotorLossMapData" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "MotorLossMap", + "description": "Create Motor from Loss Map." + }, + "MotorLossMapData": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "currents": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Currents" + }, + "power_factors": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Power Factors" + }, + "component_file_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component File Type", + "default": "MotorLossMap" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages", + "losses" + ], + "title": "MotorLossMapData", + "description": "Motor Loss Map.\n\nInput lists are two-dimensional, with each sub-list referring to\na different voltage." + }, + "MotorLossMapDataInDB": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "currents": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Currents" + }, + "power_factors": { + "anyOf": [ + { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Power Factors" + }, + "component_file_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component File Type", + "default": "MotorLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages", + "losses" + ], + "title": "MotorLossMapDataInDB", + "description": "Loss Map in Database." + }, + "MotorLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages", + "default": [] + }, + "component_type": { + "type": "string", + "const": "MotorLossMapID", + "title": "Component Type", + "default": "MotorLossMapID" + } + }, + "type": "object", + "title": "MotorLossMapID", + "description": "Motor Loss Map ID. Data referenced by ID." + }, + "MotorLossMapInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLossMap", + "title": "Component Type", + "default": "MotorLossMap" + }, + "loss_map": { + "$ref": "#/components/schemas/MotorLossMapData" + }, + "poles": { + "type": "integer", + "title": "Poles", + "default": 8 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "MotorLossMapInDB", + "description": "Motor in Database." + }, + "MotorState": { + "properties": { + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "stator_winding_temp_peak": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp Peak" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "airgap_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Airgap Temp" + }, + "bearing_temp_front": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Front" + }, + "bearing_temp_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Rear" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + } + }, + "type": "object", + "title": "MotorState", + "description": "Variables that define state of a motor.\n\nEssentially these are mostly all inputs to a Lab operating point calculation." + }, + "MotorThermalLimits": { + "properties": { + "stator": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator" + }, + "rotor": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor" + }, + "stator_limit_type": { + "type": "string", + "title": "Stator Limit Type", + "default": "average" + } + }, + "type": "object", + "title": "MotorThermalLimits", + "description": "Thermal limits for motor components." + }, + "MotorTorqueCurves": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurves", + "title": "Component Type", + "default": "MotorTorqueCurves" + }, + "torque_curves": { + "$ref": "#/components/schemas/MotorTorqueCurvesData" + } + }, + "type": "object", + "required": [ + "torque_curves" + ], + "title": "MotorTorqueCurves", + "description": "Create a motor from torque speed curves." + }, + "MotorTorqueCurvesData": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "generating_torques": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Torques" + }, + "generating_speeds": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Speeds" + }, + "component_file_type": { + "type": "string", + "const": "MotorTorqueCurve", + "title": "Component File Type", + "default": "MotorTorqueCurve" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages" + ], + "title": "MotorTorqueCurvesData", + "description": "Motor torque curve data.\n\nInput lists are two-dimensional, with each sub-list referring to\na different voltage." + }, + "MotorTorqueCurvesDataInDB": { + "properties": { + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages" + }, + "generating_torques": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Torques" + }, + "generating_speeds": { + "anyOf": [ + { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Generating Speeds" + }, + "component_file_type": { + "type": "string", + "const": "MotorTorqueCurve", + "title": "Component File Type", + "default": "MotorTorqueCurve" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "voltages" + ], + "title": "MotorTorqueCurvesDataInDB", + "description": "Torque curves in Database." + }, + "MotorTorqueCurvesID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurveID", + "title": "Component Type", + "default": "MotorTorqueCurveID" + }, + "voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltages", + "default": [] + } + }, + "type": "object", + "title": "MotorTorqueCurvesID", + "description": "Motor Lab with the data referenced by ID." + }, + "MotorTorqueCurvesInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorTorqueCurves", + "title": "Component Type", + "default": "MotorTorqueCurves" + }, + "torque_curves": { + "$ref": "#/components/schemas/MotorTorqueCurvesData" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "torque_curves" + ], + "title": "MotorTorqueCurvesInDB", + "description": "Motor in Database." + }, + "PWMFrequencyDefinition": { + "type": "integer", + "enum": [ + 1, + 2, + 3 + ], + "title": "PWMFrequencyDefinition", + "description": "How user has defined PWM frequency." + }, + "PartNames": { + "type": "string", + "enum": [ + "architecture", + "components", + "configurations", + "requirements", + "drive_cycles", + "file_items" + ], + "title": "PartNames", + "description": "Part Names." + }, + "PowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "mW", + "MW", + "hp", + "hp" + ], + "title": "PowerUnit", + "description": "Power Unit." + }, + "PressureUnit": { + "type": "string", + "enum": [ + "Pa", + "kPa", + "MPa", + "psi" + ], + "title": "PressureUnit", + "description": "Pressure Unit." + }, + "RatioUnit": { + "type": "string", + "enum": [ + "", + "%" + ], + "title": "RatioUnit", + "description": "Ratio Unit." + }, + "Requirement": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementIds" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInputsIds" + }, + { + "$ref": "#/components/schemas/StaticRequirementAccelerationIds" + } + ], + "title": "Requirement", + "description": "A way to get the actual requirement from the Union.\n\nUse Requirement().root on an object or dictionary.\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "requirement_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementIds", + "dynamic_input": "#/components/schemas/DynamicRequirementInputsIds", + "static_acceleration": "#/components/schemas/StaticRequirementAccelerationIds" + } + } + }, + "RequirementsSolved": { + "oneOf": [ + { + "$ref": "#/components/schemas/StaticRequirementSolved" + }, + { + "$ref": "#/components/schemas/DynamicRequirementSolved" + }, + { + "$ref": "#/components/schemas/DriveCycleSolved" + } + ], + "title": "RequirementsSolved", + "description": "A way to get the actual component from the Union.\n\nUse RequirementsSolved() uses keywords arguments or dictionary.\nuse RequirementsSolved.model_validate() on an object or dictionary .\n\nhttps://docs.pydantic.dev/latest/concepts/models/#helper-funct", + "discriminator": { + "propertyName": "requirement_solved_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleSolved", + "dynamic": "#/components/schemas/DynamicRequirementSolved", + "static": "#/components/schemas/StaticRequirementSolved" + } + } + }, + "ResistanceUnit": { + "type": "string", + "enum": [ + "ohm" + ], + "title": "ResistanceUnit", + "description": "Resistance Unit." + }, + "RoadEfficiencyUnit": { + "type": "string", + "enum": [ + "m/J", + "km/kWh", + "miles/kWh", + "MPGe" + ], + "title": "RoadEfficiencyUnit", + "description": "Unit of Road Efficiency." + }, + "SolvedBattery": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "battery", + "title": "Solved Component Type", + "default": "battery" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "out_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Voltages" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "out_voltages" + ], + "title": "SolvedBattery", + "description": "Solved battery node." + }, + "SolvedDisconnectClutch": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "clutch", + "title": "Solved Component Type", + "default": "clutch" + }, + "in_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Speeds" + }, + "out_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "disconnected": { + "items": { + "type": "boolean" + }, + "type": "array", + "title": "Disconnected" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_speeds", + "out_speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedDisconnectClutch", + "description": "Solved clutch." + }, + "SolvedInverter": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "inverter", + "title": "Solved Component Type", + "default": "inverter" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "out_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Voltages" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "modulation_depths": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Modulation Depths" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "out_voltages" + ], + "title": "SolvedInverter", + "description": "Solved inverter node." + }, + "SolvedMotor": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "motor", + "title": "Solved Component Type", + "default": "motor" + }, + "in_voltages": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Voltages" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "currents_d": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents D" + }, + "currents_q": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents Q" + }, + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "power_factors": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Power Factors" + }, + "temperatures_stator_winding": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Stator Winding" + }, + "temperatures_stator_winding_peak": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Stator Winding Peak" + }, + "temperatures_rotor": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Temperatures Rotor" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "in_voltages", + "speeds", + "in_torques", + "out_torques", + "currents_d", + "currents_q" + ], + "title": "SolvedMotor", + "description": "Solved motor node." + }, + "SolvedRoad": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "road", + "title": "Solved Component Type", + "default": "road" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedRoad", + "description": "Solved road node." + }, + "SolvedTransmission": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "transmission", + "title": "Solved Component Type", + "default": "transmission" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "gear_ratios_optimal": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios Optimal", + "default": [ + 0 + ] + }, + "in_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Speeds" + }, + "out_speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + }, + "losses_torque": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Torque" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "gear_ratios", + "in_speeds", + "out_speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedTransmission", + "description": "Solved transmission node." + }, + "SolvedWheel": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "side": { + "$ref": "#/components/schemas/ComponentSide", + "default": "None" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "in_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Powers" + }, + "out_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Powers" + }, + "losses": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses" + }, + "losses_ratio": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Losses Ratio" + }, + "solved_component_type": { + "type": "string", + "const": "wheel", + "title": "Solved Component Type", + "default": "wheel" + }, + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "in_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "In Torques" + }, + "out_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Out Torques" + } + }, + "type": "object", + "required": [ + "name", + "in_powers", + "out_powers", + "losses", + "losses_ratio", + "speeds", + "in_torques", + "out_torques" + ], + "title": "SolvedWheel", + "description": "Solved wheel node." + }, + "SpeedUnit": { + "type": "string", + "enum": [ + "m/s", + "km/hr", + "mph", + "ft/s" + ], + "title": "SpeedUnit", + "description": "Speed Unit." + }, + "StandardDriveCycles": { + "type": "string", + "enum": [ + "WLTP3", + "US06", + "UDDS", + "HWFET" + ], + "title": "StandardDriveCycles", + "description": "Standard Drive Cycles." + }, + "StaticRequirement": { + "properties": { + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "$ref": "#/components/schemas/Mass", + "default": { + "item_type": "config", + "name": "Default Mass Config", + "mass": 2000.0, + "add_components_mass": false, + "config_type": "mass" + } + }, + "aero": { + "$ref": "#/components/schemas/Aero", + "default": { + "item_type": "config", + "name": "Default Aero Config", + "drag_coefficient": 0.4, + "cross_sectional_area": 2.0, + "config_type": "aero" + } + }, + "wheel": { + "$ref": "#/components/schemas/WheelInput", + "default": { + "item_type": "config", + "name": "Wheel", + "mass": 0.0, + "cost": 0.0, + "rolling_radius": 0.3, + "rolling_resistance_coefficient": 0.02, + "traction_coefficient": 0.9, + "config_type": "wheel" + } + }, + "deceleration_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/DecelerationLimit" + }, + { + "type": "null" + } + ] + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "anyOf": [ + { + "$ref": "#/components/schemas/AncillaryLoad" + }, + { + "type": "null" + } + ] + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + }, + "total_tractive_torque": { + "type": "number", + "title": "Total Tractive Torque" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "aero_force": { + "type": "number", + "title": "Aero Force" + }, + "mass_force": { + "type": "number", + "title": "Mass Force" + }, + "rolling_resistance_force": { + "type": "number", + "title": "Rolling Resistance Force" + }, + "total_force": { + "type": "number", + "title": "Total Force" + }, + "total_tractive_power": { + "type": "number", + "title": "Total Tractive Power" + }, + "voltage_oc": { + "type": "number", + "title": "Voltage Oc" + } + }, + "type": "object", + "required": [ + "speed", + "total_tractive_torque", + "acceleration", + "aero_force", + "mass_force", + "rolling_resistance_force", + "total_force", + "total_tractive_power", + "voltage_oc" + ], + "title": "StaticRequirement", + "description": "Static requirement with both torque and acceleration." + }, + "StaticRequirementAccelerationIds": { + "properties": { + "_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Static Requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0.0 + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "component_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Component Configurations", + "default": [] + }, + "requirement_type": { + "type": "string", + "const": "static_acceleration", + "title": "Requirement Type", + "default": "static_acceleration" + }, + "speed": { + "type": "number", + "title": "Speed", + "default": 27.77777777777778 + }, + "acceleration": { + "type": "number", + "title": "Acceleration", + "default": 0 + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "steady_state_capability_curve": { + "type": "boolean", + "title": "Steady State Capability Curve", + "default": false + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "StaticRequirementAccelerationIds", + "description": "Static Requirement (acceleration) ID linked." + }, + "StaticRequirementSolved": { + "properties": { + "feasible": { + "type": "boolean", + "title": "Feasible" + }, + "outcome_message": { + "type": "string", + "title": "Outcome Message", + "default": "" + }, + "solved_components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SolvedBattery" + }, + { + "$ref": "#/components/schemas/SolvedInverter" + }, + { + "$ref": "#/components/schemas/SolvedMotor" + }, + { + "$ref": "#/components/schemas/SolvedTransmission" + }, + { + "$ref": "#/components/schemas/SolvedDisconnectClutch" + }, + { + "$ref": "#/components/schemas/SolvedWheel" + }, + { + "$ref": "#/components/schemas/SolvedRoad" + } + ], + "discriminator": { + "propertyName": "solved_component_type", + "mapping": { + "battery": "#/components/schemas/SolvedBattery", + "clutch": "#/components/schemas/SolvedDisconnectClutch", + "inverter": "#/components/schemas/SolvedInverter", + "motor": "#/components/schemas/SolvedMotor", + "road": "#/components/schemas/SolvedRoad", + "transmission": "#/components/schemas/SolvedTransmission", + "wheel": "#/components/schemas/SolvedWheel" + } + } + }, + "type": "array", + "title": "Solved Components" + }, + "architecture_outline": { + "$ref": "#/components/schemas/ArchitectureOutline", + "default": { + "number_of_front_motors": 0, + "number_of_front_wheels": 0, + "number_of_rear_motors": 0, + "number_of_rear_wheels": 0 + } + }, + "energy_axle_split": { + "additionalProperties": { + "type": "number" + }, + "propertyNames": { + "$ref": "#/components/schemas/ComponentAxle" + }, + "type": "object", + "title": "Energy Axle Split", + "default": {} + }, + "components_mass": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Mass" + }, + "components_cost": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Components Cost" + }, + "requirement_solved_type": { + "type": "string", + "const": "static", + "title": "Requirement Solved Type", + "default": "static" + }, + "requirement": { + "$ref": "#/components/schemas/StaticRequirement" + }, + "traction_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/StaticRequirement" + }, + { + "type": "null" + } + ] + }, + "capability_curve": { + "anyOf": [ + { + "$ref": "#/components/schemas/CapabilityCurve" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Error Code" + } + }, + "type": "object", + "required": [ + "feasible", + "solved_components", + "requirement", + "traction_limit", + "capability_curve" + ], + "title": "StaticRequirementSolved", + "description": "Solution to static requirement given to APP." + }, + "Statuses": { + "type": "string", + "enum": [ + "FINISHED", + "QUEUED", + "RUNNING", + "FAILED" + ], + "title": "Statuses", + "description": "Statuses." + }, + "SubmittedJob": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "job_name": { + "type": "string", + "title": "Job Name" + }, + "docker_tag": { + "type": "string", + "title": "Docker Tag" + }, + "simulation_id": { + "type": "string", + "title": "Simulation Id" + } + }, + "type": "object", + "required": [ + "job_id", + "job_name", + "docker_tag", + "simulation_id" + ], + "title": "SubmittedJob", + "description": "Submitted Job." + }, + "SurfaceConditionTractionConfigs": { + "type": "string", + "enum": [ + "Snow", + "Wet", + "Dry" + ], + "title": "SurfaceConditionTractionConfigs", + "description": "Surface conditions that affect the traction coefficient." + }, + "TemperatureUnit": { + "type": "string", + "enum": [ + "K", + "\u00b0C", + "\u00b0F" + ], + "title": "TemperatureUnit", + "description": "Temperature Unit." + }, + "Template": { + "properties": { + "_id": { + "type": "string", + "title": "Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id", + "deprecated": true + }, + "design_identifier": { + "type": "string", + "title": "Design Identifier" + }, + "name": { + "type": "string", + "title": "Name" + } + }, + "type": "object", + "required": [ + "design_identifier", + "name" + ], + "title": "Template", + "description": "Template." + }, + "ThermalModelDetails": { + "properties": { + "model_type": { + "$ref": "#/components/schemas/ThermalModelType", + "default": "None" + }, + "speeds": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Speeds" + }, + "flow_rates": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Flow Rates" + } + }, + "type": "object", + "title": "ThermalModelDetails", + "description": "Thermal Model Details." + }, + "ThermalModelSolver": { + "properties": { + "component_file_type": { + "type": "string", + "const": "ThermalModel", + "title": "Component File Type", + "default": "ThermalModel" + }, + "network": { + "$ref": "#/components/schemas/ThermalNetwork" + }, + "loss_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Loss Map" + }, + "temperature_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Temperature Map" + } + }, + "type": "object", + "required": [ + "network", + "loss_map", + "temperature_map" + ], + "title": "ThermalModelSolver", + "description": "Thermal model.\n\nContains the thermal network defined by nodes and edges, and mappings of which nodes\ncorrespond to which losses and temperatures." + }, + "ThermalModelType": { + "type": "string", + "enum": [ + "None", + "OneDimension", + "TwoDimension" + ], + "title": "ThermalModelType", + "description": "Types of thermal model." + }, + "ThermalNetwork": { + "properties": { + "network_dict": { + "additionalProperties": { + "type": "object", + "description": "A NetworkX DiGraph serialized as node-link data." + }, + "type": "object", + "title": "Network Dict" + }, + "speed_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Speed Dict" + }, + "flow_rate_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Flow Rate Dict" + } + }, + "type": "object", + "required": [ + "network_dict", + "speed_dict", + "flow_rate_dict" + ], + "title": "ThermalNetwork", + "description": "Lumped parameter thermal network.\n\nIt is constructed from sets of nodes and edges (connections) at different speeds\nand flow rates.\n\nFields:\n speed_dict (dict): Dictionary mapping indices to speed values.\n flow_rate_dict (dict): Dictionary mapping indices to flow rate values.\n edges (dict): Dictionary mapping indices to edge lists.\n nodes (dict): Dictionary mapping indices to node lists." + }, + "TimeUnit": { + "type": "string", + "enum": [ + "s", + "ms", + "min", + "hr" + ], + "title": "TimeUnit", + "description": "Time Unit." + }, + "TorqueUnit": { + "type": "string", + "enum": [ + "N\u00b7m", + "ft\u00b7lbf", + "kN\u00b7m", + "MN\u00b7m", + "dyn\u00b7cm" + ], + "title": "TorqueUnit", + "description": "Torque Unit." + }, + "TotalTractiveTorqueGraph": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "total_tractive_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Torques" + }, + "aero_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Aero Forces" + }, + "mass_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Mass Forces" + }, + "total_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Forces" + }, + "total_tractive_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Powers" + } + }, + "type": "object", + "required": [ + "speeds", + "acceleration", + "total_tractive_torques", + "aero_forces", + "mass_forces", + "total_forces", + "total_tractive_powers" + ], + "title": "TotalTractiveTorqueGraph", + "description": "Total Tractive Torque Graph." + }, + "TransientCalculationPoint": { + "properties": { + "index": { + "type": "integer", + "title": "Index" + }, + "duration": { + "type": "number", + "title": "Duration" + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "gradient": { + "type": "number", + "title": "Gradient" + }, + "distance": { + "type": "number", + "title": "Distance" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "headwind": { + "type": "number", + "title": "Headwind" + }, + "altitude": { + "type": "number", + "title": "Altitude" + }, + "charging_power": { + "type": "number", + "title": "Charging Power", + "default": 0.0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "ancillary_load": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load" + } + }, + "type": "object", + "required": [ + "index", + "duration", + "speed", + "gradient", + "distance", + "acceleration", + "headwind", + "altitude" + ], + "title": "TransientCalculationPoint", + "description": "Drive Cycle Point.\n\nindex (int): index of the point within the calculation\nduration (float): length of the time step\nspeed (float): speed at the end of the time step\ngradient (float): gradient of the time step\ndistance (float): distance travelled during the time step\nacceleration (float): acceleration during the time step, calculate from\n the speed of this point and the previous point" + }, + "TransientTotalValues": { + "properties": { + "energy_consumed": { + "type": "number", + "title": "Energy Consumed", + "default": 0 + }, + "energy_recovered": { + "type": "number", + "title": "Energy Recovered", + "default": 0 + }, + "net_energy_consumed": { + "type": "number", + "title": "Net Energy Consumed", + "default": 0 + }, + "energy_charging": { + "type": "number", + "title": "Energy Charging", + "default": 0 + }, + "aero_contribution": { + "type": "number", + "title": "Aero Contribution", + "default": 0 + }, + "rolling_resistance_contribution": { + "type": "number", + "title": "Rolling Resistance Contribution", + "default": 0 + }, + "mass_contribution": { + "type": "number", + "title": "Mass Contribution", + "default": 0 + }, + "ancillary_load": { + "type": "number", + "title": "Ancillary Load", + "default": 0 + }, + "loss_by_component": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Loss By Component" + }, + "loss_by_component_ratio": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Loss By Component Ratio" + }, + "efficiency_by_component": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Efficiency By Component" + } + }, + "type": "object", + "title": "TransientTotalValues", + "description": "Total values over the course of a transient calculation." + }, + "TransmissionLossCoefficients": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + } + }, + "type": "object", + "title": "TransmissionLossCoefficients", + "description": "Input values for transmission model for fixed efficiencies." + }, + "TransmissionLossCoefficientsInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "TransmissionLossCoefficientsInDB", + "description": "Transmission In DB." + }, + "TransmissionLossMap": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Loss Map Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component Type", + "default": "TransmissionLossMap" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "loss_map": { + "$ref": "#/components/schemas/TransmissionLossMapData" + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "TransmissionLossMap", + "description": "Input values for transmission model with loss data." + }, + "TransmissionLossMapData": { + "properties": { + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "component_file_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component File Type", + "default": "TransmissionLossMap" + } + }, + "type": "object", + "required": [ + "gear_ratios", + "speeds", + "torques", + "losses", + "efficiencies" + ], + "title": "TransmissionLossMapData", + "description": "Data for transmission loss maps.\n\n2D lists, one list per gear ratio." + }, + "TransmissionLossMapDataInDB": { + "properties": { + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios" + }, + "speeds": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "component_file_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component File Type", + "default": "TransmissionLossMap" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "gear_ratios", + "speeds", + "torques", + "losses", + "efficiencies" + ], + "title": "TransmissionLossMapDataInDB", + "description": "Loss Map in Database." + }, + "TransmissionLossMapID": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + }, + "data_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Id" + }, + "submitted_job": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubmittedJob" + }, + { + "type": "null" + } + ] + }, + "thermal_model_details": { + "$ref": "#/components/schemas/ThermalModelDetails" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [] + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMapID", + "title": "Component Type", + "default": "TransmissionLossMapID" + } + }, + "type": "object", + "title": "TransmissionLossMapID", + "description": "Transmission Loss Map ID. Data referenced by ID." + }, + "TransmissionLossMapInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Loss Map Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossMap", + "title": "Component Type", + "default": "TransmissionLossMap" + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "loss_map": { + "$ref": "#/components/schemas/TransmissionLossMapData" + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "loss_map" + ], + "title": "TransmissionLossMapInDB", + "description": "Transmission In DB." + }, + "TransmissionNeglect": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionNeglect", + "title": "Component Type", + "default": "TransmissionNeglect" + } + }, + "type": "object", + "title": "TransmissionNeglect", + "description": "Placeholder class for when neglecting transmission.\n\nThis is used when we have in wheel motors." + }, + "UnitChoices": { + "properties": { + "unit_type_to_unit_map": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/MassUnit" + }, + { + "$ref": "#/components/schemas/TimeUnit" + }, + { + "$ref": "#/components/schemas/ForceUnit" + }, + { + "$ref": "#/components/schemas/TorqueUnit" + }, + { + "$ref": "#/components/schemas/TemperatureUnit" + }, + { + "$ref": "#/components/schemas/LengthUnit" + }, + { + "$ref": "#/components/schemas/AreaUnit" + }, + { + "$ref": "#/components/schemas/VolumeUnit" + }, + { + "$ref": "#/components/schemas/SpeedUnit" + }, + { + "$ref": "#/components/schemas/AccelerationUnit" + }, + { + "$ref": "#/components/schemas/AngularSpeedUnit" + }, + { + "$ref": "#/components/schemas/AngularAccelerationUnit" + }, + { + "$ref": "#/components/schemas/EnergyUnit" + }, + { + "$ref": "#/components/schemas/PowerUnit" + }, + { + "$ref": "#/components/schemas/DensityUnit" + }, + { + "$ref": "#/components/schemas/InertiaUnit" + }, + { + "$ref": "#/components/schemas/PressureUnit" + }, + { + "$ref": "#/components/schemas/RatioUnit" + }, + { + "$ref": "#/components/schemas/VoltageUnit" + }, + { + "$ref": "#/components/schemas/CurrentUnit" + }, + { + "$ref": "#/components/schemas/ResistanceUnit" + }, + { + "$ref": "#/components/schemas/ElectricChargeUnit" + }, + { + "$ref": "#/components/schemas/ElectricalEnergyUnit" + }, + { + "$ref": "#/components/schemas/ElectricalPowerUnit" + }, + { + "$ref": "#/components/schemas/AngleUnit" + }, + { + "$ref": "#/components/schemas/RoadEfficiencyUnit" + }, + { + "$ref": "#/components/schemas/FrequencyUnit" + }, + { + "$ref": "#/components/schemas/VolumetricFlowRateUnit" + } + ] + }, + "type": "object", + "title": "Unit Type To Unit Map", + "default": { + "mass": "kg", + "time": "s", + "force": "N", + "torque": "N\u00b7m", + "temperature": "\u00b0C", + "length": "m", + "distance": "km", + "area": "m\u00b2", + "volume": "m\u00b3", + "speed": "km/hr", + "acceleration": "m/s\u00b2", + "angular_speed": "rpm", + "angular_acceleration": "rps/s", + "energy": "J", + "power": "kW", + "density": "kg/m\u00b3", + "inertia": "kg\u00b7m\u00b2", + "pressure": "Pa", + "ratio": "%", + "voltage": "V", + "current": "A", + "resistance": "ohm", + "electric_charge": "A\u00b7s", + "electrical_energy": "kWh", + "electrical_power": "kW", + "gradient": "deg", + "road_efficiency": "km/kWh", + "frequency": "Hz", + "volumetric_flow_rate": "l/min" + } + } + }, + "type": "object", + "title": "UnitChoices", + "description": "Unit Choice for the analysis.\n\nWe might not need all of these.\nWe might want to create preset groups of these (eg. MKS, Imperial etc)" + }, + "UploadedFile": { + "properties": { + "cloud_path": { + "type": "string", + "title": "Cloud Path" + }, + "file_name": { + "type": "string", + "title": "File Name" + }, + "file_size": { + "type": "integer", + "title": "File Size" + } + }, + "type": "object", + "required": [ + "cloud_path", + "file_name", + "file_size" + ], + "title": "UploadedFile", + "description": "Upload File Model." + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "VoltageUnit": { + "type": "string", + "enum": [ + "V", + "mV", + "kV" + ], + "title": "VoltageUnit", + "description": "Voltage Unit." + }, + "VolumeUnit": { + "type": "string", + "enum": [ + "m\u00b3", + "mm\u00b3", + "cm\u00b3", + "in\u00b3", + "ft\u00b3", + "yd\u00b3", + "l", + "ml", + "cc" + ], + "title": "VolumeUnit", + "description": "Volume Unit." + }, + "VolumetricFlowRateUnit": { + "type": "string", + "enum": [ + "m\u00b3/s", + "m\u00b3/min", + "l/s", + "l/min" + ], + "title": "VolumetricFlowRateUnit", + "description": "Unit of volumetric flow rate." + }, + "WheelInDB": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "_id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "title": "WheelInDB", + "description": "Wheel with Database ID." + }, + "WheelInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + } + }, + "type": "object", + "title": "WheelInput", + "description": "Wheel as a configuration.\n\nThis is what is stored in the database and the class used for creation." + }, + "WheelRollingResistanceConfigs": { + "type": "string", + "enum": [ + "Car on asphalt", + "Car on concrete", + "Car on gravel" + ], + "title": "WheelRollingResistanceConfigs", + "description": "Condition on wheels which affect the rolling resistance coefficient." + } + }, + "securitySchemes": { + "APIKeyHeader": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "servers": [ + { + "url": "/api" + } + ] +} \ No newline at end of file diff --git a/schema/openapi_v2.json b/schema/openapi_v2.json new file mode 100644 index 00000000..63529cb2 --- /dev/null +++ b/schema/openapi_v2.json @@ -0,0 +1,6486 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "ConceptEV-API", + "summary": "API Endpoint documentation for ConceptEV", + "version": "0.2.158" + }, + "paths": { + "/v2/concept/{concept_id}/job/availability": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Check Job Backend Availability", + "description": "Check if job backend is available.", + "operationId": "check_job_backend_availability", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Response Check Job Backend Availability" + } + } + } + }, + "404": { + "description": "Not found" + }, + "503": { + "description": "Job backend is not available" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{concept_id}/job": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Jobs List", + "description": "Retrieve list of jobs.", + "operationId": "list_jobs", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JobOutput" + }, + "title": "Response List Jobs" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Job", + "description": "Create a new requirement job.\n\nStores an initial RUNNING ConceptJobRecord in the concept immediately\n(as a PartType.JOB part), then updates it with the output URL once the\nsolver finishes. Returns the stored record so the caller has the part id.", + "operationId": "create_job", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptJobRecord" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Invalid job request or missing concept data" + } + } + } + }, + "/v2/concept/{concept_id}/job/{job_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Job", + "description": "Retrieve job status.", + "operationId": "get_job", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobOutput" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Job", + "description": "Delete a job from the backend.", + "operationId": "delete_job", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{concept_id}/job/{job_id}/files/{file_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Job File", + "description": "Retrieve a job output file.\n\nFor local backends the file bytes are streamed directly. For remote\nbackends (e.g. HPS/S3) a 307 redirect to a presigned download URL is\nreturned instead.", + "operationId": "get_job_file", + "parameters": [ + { + "name": "concept_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Concept Id" + } + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + }, + "307": { + "description": "Redirect to presigned download URL" + }, + "409": { + "description": "Job output file is not yet available" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Concept", + "description": "Get a concept by ID from the database.", + "operationId": "get_concept", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update Concept", + "description": "Update an existing concept in the database.", + "operationId": "update_concept", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Concept", + "description": "Delete a concept from the database.", + "operationId": "delete_concept", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Concept", + "description": "Create a new concept in the database.", + "operationId": "create_concept", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptInput" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/save": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Save Concept", + "description": "Save a concept to a specified file path (filesystem backend only).\n\nCopies the ``.cev`` archive to the given path, re-registers the concept\nat that location, and sets ``save_state`` to ``SaveState.SAVED``.", + "operationId": "save_concept", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptSaveRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "400": { + "description": "Not available for non-filesystem backends" + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/files/{file_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get File", + "description": "Get file metadata for a concept.", + "operationId": "get_file_item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemOutput" + } + } + } + }, + "404": { + "description": "Concept or file not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update File", + "description": "Update an existing file for a concept.", + "operationId": "update_file_item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemOutput" + } + } + } + }, + "404": { + "description": "Concept or file not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete File", + "description": "Delete a file from a concept.", + "operationId": "delete_file_item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Concept or file not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/files": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create File", + "description": "Upload a new file for a concept.", + "operationId": "create_file_item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + }, + { + "name": "component_file_type", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ComponentFileType" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_create_file_item" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileItemCreateResponse" + } + } + } + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "File could not be processed" + } + } + } + }, + "/v2/concept/{id}/{part_type}/{part_id}": { + "get": { + "tags": [ + "concept-v2" + ], + "summary": "Get Concept Part", + "description": "Get a specific part from a concept.", + "operationId": "get_concept_part", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Get Concept Part" + } + } + } + }, + "404": { + "description": "Concept or part not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "concept-v2" + ], + "summary": "Update Concept Part", + "description": "Update an existing part within a concept.", + "operationId": "update_concept_part", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabInput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureInput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleInput" + } + ], + "title": "Part" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Update Concept Part" + } + } + } + }, + "404": { + "description": "Concept or part not found" + }, + "422": { + "description": "Validation error or invalid requirement IDs" + } + } + }, + "delete": { + "tags": [ + "concept-v2" + ], + "summary": "Delete Concept Part", + "description": "Delete a part from a concept.", + "operationId": "delete_concept_part", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Concept or part not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/{part_type}": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Create Concept Part", + "description": "Create a new part within a concept.", + "operationId": "create_concept_part", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PartType" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabInput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureInput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleInput" + } + ], + "title": "Part" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + { + "$ref": "#/components/schemas/ConceptJobRecord" + } + ], + "title": "Response Create Concept Part" + } + } + } + }, + "404": { + "description": "Concept not found" + }, + "422": { + "description": "Validation error or invalid requirement IDs" + } + } + } + }, + "/v2/concept:open": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Open Concept", + "description": "Open a .cev concept file and load it into the file-system database.\n\nReads the concept ID from inside the file so the filename can be any\nhuman-readable name rather than the UUID. Registers the path so all\nsubsequent operations resolve the correct location without requiring\nanother open call. Multiple files in different directories can be\nregistered independently.\n\nNote: This endpoint is only meaningful when the file-system backend is\nactive. It is registered unconditionally so the route exists regardless\nof which backend was configured at import time (important for tests that\nswap configs via fixtures).", + "operationId": "open_concept", + "parameters": [ + { + "name": "path_to_file", + "in": "query", + "required": true, + "schema": { + "type": "string", + "format": "path", + "title": "Path To File" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConceptOutput" + } + } + } + }, + "400": { + "description": "Not available for non-filesystem backends" + }, + "404": { + "description": "File not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/concept/{id}/component/{part_id}:get_display_data": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Get Display Data", + "description": "Get graph data for a component.\n\nSupported component types:\n\n- **MotorLab** \u2014 returns ``LossMapGridLab`` or ``LossMapGridPower``\n- **BatteryLookupTable** \u2014 returns ``BatteryLookupTableData``\n- **TransmissionLossCoefficients** \u2014 returns ``LossMapGridTorque``\n\nArgs:\n id: The concept ID.\n part_id: The component part ID.\n database: Injected database dependency.\n unit_choices: Injected unit-choice dependency.\n extra_args: Optional loss-map calculation arguments (speed, voltage\u2026).\n\nReturns:\n A display-data object in user units.\n\nRaises:\n HTTPException 404: If the component or its associated file is not found.\n HTTPException 422: If the component type does not support display data.", + "operationId": "get_component_display_data", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + }, + { + "name": "part_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Part Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ComponentLossMapArgs" + }, + { + "type": "null" + } + ], + "title": "Extra Args" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/LossMapGridLab" + }, + { + "$ref": "#/components/schemas/LossMapGridPower" + }, + {} + ], + "title": "Response Get Component Display Data" + } + } + } + }, + "404": { + "description": "Concept or component not found" + }, + "422": { + "description": "Component type does not support display data" + } + } + } + }, + "/v2/concept/{id}:calculate_forces": { + "post": { + "tags": [ + "concept-v2" + ], + "summary": "Calculate Total Forces", + "description": "Calculate the total tractive torque.", + "operationId": "calculate_total_forces", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraphInput" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalTractiveTorqueGraphOutput" + } + } + } + }, + "404": { + "description": "Concept or required configuration parts not found" + }, + "422": { + "description": "Invalid input data" + } + } + } + }, + "/unit_choices": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Read", + "description": "Get from ID.", + "operationId": "read_unit_choices_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + } + } + }, + "put": { + "tags": [ + "Unit Choices" + ], + "summary": "Update", + "description": "Update with new parameters.", + "operationId": "update_unit_choices_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "post": { + "tags": [ + "Unit Choices" + ], + "summary": "Create Unit Choices", + "description": "Create.", + "operationId": "create_unit_choices_unit_choices_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnitChoices" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + }, + "delete": { + "tags": [ + "Unit Choices" + ], + "summary": "Delete", + "description": "Delete by ID.", + "operationId": "delete_unit_choices_delete", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not found" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/unit_choices/info": { + "get": { + "tags": [ + "Unit Choices" + ], + "summary": "Get Info", + "description": "Get table of units for frontend generation.", + "operationId": "get_info_unit_choices_info_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Response Get Info Unit Choices Info Get" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + } + }, + "components": { + "schemas": { + "AccelerationUnit": { + "type": "string", + "enum": [ + "m/s\u00b2", + "km/hr/s", + "mph/s" + ], + "title": "AccelerationUnit", + "description": "Acceleration Unit." + }, + "Aero": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + } + }, + "type": "object", + "title": "Aero", + "description": "Aero Configuration." + }, + "AeroInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "AeroInput", + "description": "Aero Input." + }, + "AeroOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Aero Config" + }, + "drag_coefficient": { + "type": "number", + "title": "Drag Coefficient", + "default": 0.4 + }, + "drag_coefficient_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Drag Coefficient Rear" + }, + "cross_sectional_area": { + "type": "number", + "title": "Cross Sectional Area", + "default": 2 + }, + "config_type": { + "type": "string", + "const": "aero", + "title": "Config Type", + "default": "aero" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "AeroOutput", + "description": "Aero Output." + }, + "AngleUnit": { + "type": "string", + "enum": [ + "rad", + "deg", + "%" + ], + "title": "AngleUnit", + "description": "Unit of Angle." + }, + "AngularAccelerationUnit": { + "type": "string", + "enum": [ + "rad/s\u00b2", + "rpm/s", + "rps/s", + "deg/s\u00b2" + ], + "title": "AngularAccelerationUnit", + "description": "Angular Acceleration Unit." + }, + "AngularSpeedUnit": { + "type": "string", + "enum": [ + "rad/s", + "rpm", + "rps", + "deg/s" + ], + "title": "AngularSpeedUnit", + "description": "Angular Speed Unit." + }, + "ArchitectureInput": { + "properties": { + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 2 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 2 + }, + "battery": { + "type": "null", + "title": "Battery" + }, + "front_transmission": { + "type": "null", + "title": "Front Transmission" + }, + "front_motor": { + "type": "null", + "title": "Front Motor" + }, + "front_inverter": { + "type": "null", + "title": "Front Inverter" + }, + "front_clutch": { + "type": "null", + "title": "Front Clutch" + }, + "rear_transmission": { + "type": "null", + "title": "Rear Transmission" + }, + "rear_motor": { + "type": "null", + "title": "Rear Motor" + }, + "rear_inverter": { + "type": "null", + "title": "Rear Inverter" + }, + "rear_clutch": { + "type": "null", + "title": "Rear Clutch" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "part_type": { + "type": "string", + "const": "architecture", + "title": "Part Type", + "default": "architecture" + } + }, + "type": "object", + "required": [ + "battery_id" + ], + "title": "ArchitectureInput", + "description": "Architecture Input." + }, + "ArchitectureOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "wheelbase": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Wheelbase" + }, + "number_of_front_motors": { + "type": "integer", + "title": "Number Of Front Motors", + "default": 0 + }, + "number_of_front_wheels": { + "type": "integer", + "title": "Number Of Front Wheels", + "default": 2 + }, + "number_of_rear_motors": { + "type": "integer", + "title": "Number Of Rear Motors", + "default": 0 + }, + "number_of_rear_wheels": { + "type": "integer", + "title": "Number Of Rear Wheels", + "default": 2 + }, + "battery": { + "type": "null", + "title": "Battery" + }, + "front_transmission": { + "type": "null", + "title": "Front Transmission" + }, + "front_motor": { + "type": "null", + "title": "Front Motor" + }, + "front_inverter": { + "type": "null", + "title": "Front Inverter" + }, + "front_clutch": { + "type": "null", + "title": "Front Clutch" + }, + "rear_transmission": { + "type": "null", + "title": "Rear Transmission" + }, + "rear_motor": { + "type": "null", + "title": "Rear Motor" + }, + "rear_inverter": { + "type": "null", + "title": "Rear Inverter" + }, + "rear_clutch": { + "type": "null", + "title": "Rear Clutch" + }, + "battery_id": { + "type": "string", + "title": "Battery Id" + }, + "front_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Transmission Id" + }, + "front_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Motor Id" + }, + "front_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Inverter Id" + }, + "front_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Front Clutch Id" + }, + "rear_transmission_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Transmission Id" + }, + "rear_motor_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Motor Id" + }, + "rear_inverter_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Inverter Id" + }, + "rear_clutch_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Rear Clutch Id" + }, + "part_type": { + "type": "string", + "const": "architecture", + "title": "Part Type", + "default": "architecture" + }, + "components_cost": { + "type": "number", + "title": "Components Cost", + "default": 0 + }, + "components_mass": { + "type": "number", + "title": "Components Mass", + "default": 0 + }, + "max_wheel_speed": { + "type": "number", + "title": "Max Wheel Speed", + "default": 0 + } + }, + "type": "object", + "required": [ + "id", + "battery_id" + ], + "title": "ArchitectureOutput", + "description": "Architecture Output." + }, + "AreaUnit": { + "type": "string", + "enum": [ + "m\u00b2", + "mm\u00b2", + "cm\u00b2", + "in\u00b2", + "ft\u00b2", + "yd\u00b2" + ], + "title": "AreaUnit", + "description": "Area Unit." + }, + "BatteryConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "battery", + "title": "Component Config Type", + "default": "battery" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + } + }, + "type": "object", + "title": "BatteryConfiguration", + "description": "Configuration that can change characteristics of the battery." + }, + "BatteryFixedVoltagesInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "title": "BatteryFixedVoltagesInput", + "description": "Battery Fixed Voltages Input." + }, + "BatteryFixedVoltagesOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Fixed Voltages Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryFixedVoltages", + "title": "Component Type", + "default": "BatteryFixedVoltages" + }, + "voltage_max": { + "type": "number", + "title": "Voltage Max", + "default": 400.0 + }, + "voltage_min": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage Min" + }, + "charge_acceptance_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Acceptance Limit" + }, + "charge_release_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Charge Release Limit" + }, + "capacity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Capacity" + }, + "internal_resistance_charge": { + "type": "number", + "title": "Internal Resistance Charge", + "default": 0.0 + }, + "internal_resistance_discharge": { + "type": "number", + "title": "Internal Resistance Discharge", + "default": 0.0 + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "BatteryFixedVoltagesOutput", + "description": "Battery Fixed Voltages Output." + }, + "BatteryLookupTableData": { + "properties": { + "voltage": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Voltage" + }, + "state_of_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "State Of Charge" + }, + "usable_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Usable Charge" + }, + "power_limit_charge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Charge" + }, + "power_limit_discharge": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Power Limit Discharge" + }, + "internal_resistance_charge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Charge" + }, + "internal_resistance_discharge": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance Discharge" + }, + "internal_resistance": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Internal Resistance", + "default": [] + }, + "component_file_type": { + "type": "string", + "const": "BatteryLookupTable", + "title": "Component File Type", + "default": "BatteryLookupTable" + } + }, + "type": "object", + "required": [ + "voltage", + "state_of_charge", + "usable_charge", + "power_limit_charge", + "power_limit_discharge", + "internal_resistance_charge", + "internal_resistance_discharge" + ], + "title": "BatteryLookupTableData", + "description": "Data for a lookup table battery." + }, + "BatteryLookupTableInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "lookup_table" + ], + "title": "BatteryLookupTableInput", + "description": "Battery Lookup Table Input." + }, + "BatteryLookupTableOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Lookup Table Battery" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "BatteryLookupData", + "title": "Component Type", + "default": "BatteryLookupData" + }, + "lookup_table": { + "$ref": "#/components/schemas/BatteryLookupTableData" + }, + "state": { + "$ref": "#/components/schemas/BatteryState", + "default": {} + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id", + "lookup_table" + ], + "title": "BatteryLookupTableOutput", + "description": "Battery Lookup Table Output." + }, + "BatteryState": { + "properties": { + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Temperature" + } + }, + "type": "object", + "title": "BatteryState", + "description": "Variables that define state of a battery." + }, + "Body_create_file_item": { + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/octet-stream", + "title": "File" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "Body_create_file_item" + }, + "ComponentAxle": { + "type": "string", + "enum": [ + "Front", + "Rear", + "None" + ], + "title": "ComponentAxle", + "description": "Component axle." + }, + "ComponentConfigurationSet": { + "properties": { + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorConfiguration" + }, + { + "$ref": "#/components/schemas/BatteryConfiguration" + } + ], + "discriminator": { + "propertyName": "component_config_type", + "mapping": { + "battery": "#/components/schemas/BatteryConfiguration", + "motor": "#/components/schemas/MotorConfiguration" + } + } + }, + "type": "array", + "title": "Configurations" + } + }, + "type": "object", + "title": "ComponentConfigurationSet", + "description": "Set of component configurations." + }, + "ComponentFileType": { + "type": "string", + "enum": [ + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "transmission_torque_grid_file", + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "thermal_model_file" + ], + "title": "ComponentFileType", + "description": "Types of files." + }, + "ComponentLossMapArgs": { + "properties": { + "voltage": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Voltage" + }, + "gear_ratio": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Gear Ratio" + }, + "speed": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Speed" + }, + "dc_current": { + "type": "number", + "title": "Dc Current", + "default": 50 + }, + "power_factor": { + "type": "number", + "title": "Power Factor", + "default": 1 + }, + "phase_current_max": { + "type": "number", + "title": "Phase Current Max", + "default": 400 + }, + "frequency": { + "type": "number", + "title": "Frequency", + "default": 1000 + } + }, + "type": "object", + "title": "ComponentLossMapArgs", + "description": "Args for create component loss maps.\n\nAllows unit transforming." + }, + "ConceptInput": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "file_items": { + "items": { + "$ref": "#/components/schemas/FileItemOutput" + }, + "type": "array", + "title": "File Items", + "default": [] + }, + "components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabInput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesInput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableInput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsInput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesInput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableInput", + "MotorLabModel": "#/components/schemas/MotorLabInput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsInput" + } + } + }, + "type": "array", + "title": "Components", + "default": [] + }, + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroInput" + }, + { + "$ref": "#/components/schemas/MassInput" + }, + { + "$ref": "#/components/schemas/WheelInput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroInput", + "mass": "#/components/schemas/MassInput", + "wheel": "#/components/schemas/WheelInput" + } + } + }, + "type": "array", + "title": "Configurations", + "default": [] + }, + "architectures": { + "items": { + "$ref": "#/components/schemas/ArchitectureInput" + }, + "type": "array", + "title": "Architectures", + "default": [] + }, + "requirements": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementInput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementInput" + }, + { + "$ref": "#/components/schemas/StaticRequirementInput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementInput", + "dynamic": "#/components/schemas/DynamicRequirementInput", + "static": "#/components/schemas/StaticRequirementInput" + } + } + }, + "type": "array", + "title": "Requirements", + "default": [] + }, + "drive_cycles": { + "items": { + "$ref": "#/components/schemas/DriveCycleInput" + }, + "type": "array", + "title": "Drive Cycles", + "default": [] + } + }, + "type": "object", + "title": "ConceptInput", + "description": "Concept input \u2014 uses input variants of each part group." + }, + "ConceptJobRecord": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "job", + "title": "Part Type", + "default": "job" + }, + "name": { + "type": "string", + "title": "Name" + }, + "status": { + "type": "string", + "title": "Status", + "default": "RUNNING" + }, + "output_urls": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Output Urls", + "default": [] + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + } + }, + "type": "object", + "required": [ + "id", + "name" + ], + "title": "ConceptJobRecord", + "description": "A job record stored as a part inside a concept.\n\nTracks backend job status and the output file URLs written by the solver.\nStored under PartType.JOB so it uses the same CRUD path as all other parts." + }, + "ConceptOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "Study" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Project Id" + }, + "design_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Id" + }, + "design_instance_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Design Instance Id" + }, + "file_items": { + "items": { + "$ref": "#/components/schemas/FileItemOutput" + }, + "type": "array", + "title": "File Items", + "default": [] + }, + "id": { + "type": "string", + "title": "Id" + }, + "save_state": { + "$ref": "#/components/schemas/SaveState", + "default": "saved" + }, + "components": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MotorLabOutput" + }, + { + "$ref": "#/components/schemas/BatteryFixedVoltagesOutput" + }, + { + "$ref": "#/components/schemas/BatteryLookupTableOutput" + }, + { + "$ref": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + ], + "discriminator": { + "propertyName": "component_type", + "mapping": { + "BatteryFixedVoltages": "#/components/schemas/BatteryFixedVoltagesOutput", + "BatteryLookupData": "#/components/schemas/BatteryLookupTableOutput", + "MotorLabModel": "#/components/schemas/MotorLabOutput", + "TransmissionLossCoefficients": "#/components/schemas/TransmissionLossCoefficientsOutput" + } + } + }, + "type": "array", + "title": "Components", + "default": [] + }, + "configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/AeroOutput" + }, + { + "$ref": "#/components/schemas/MassOutput" + }, + { + "$ref": "#/components/schemas/WheelOutput" + } + ], + "discriminator": { + "propertyName": "config_type", + "mapping": { + "aero": "#/components/schemas/AeroOutput", + "mass": "#/components/schemas/MassOutput", + "wheel": "#/components/schemas/WheelOutput" + } + } + }, + "type": "array", + "title": "Configurations", + "default": [] + }, + "architectures": { + "items": { + "$ref": "#/components/schemas/ArchitectureOutput" + }, + "type": "array", + "title": "Architectures", + "default": [] + }, + "requirements": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DriveCycleRequirementOutput" + }, + { + "$ref": "#/components/schemas/DynamicRequirementOutput" + }, + { + "$ref": "#/components/schemas/StaticRequirementOutput" + } + ], + "discriminator": { + "propertyName": "requirement_input_type", + "mapping": { + "drive_cycle": "#/components/schemas/DriveCycleRequirementOutput", + "dynamic": "#/components/schemas/DynamicRequirementOutput", + "static": "#/components/schemas/StaticRequirementOutput" + } + } + }, + "type": "array", + "title": "Requirements", + "default": [] + }, + "drive_cycles": { + "items": { + "$ref": "#/components/schemas/DriveCycleOutput" + }, + "type": "array", + "title": "Drive Cycles", + "default": [] + }, + "jobs": { + "items": { + "$ref": "#/components/schemas/ConceptJobRecord" + }, + "type": "array", + "title": "Jobs", + "default": [] + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "ConceptOutput", + "description": "Concept output with database ID \u2014 uses output variants of each part group." + }, + "ConceptSaveRequest": { + "properties": { + "path": { + "type": "string", + "title": "Path" + } + }, + "type": "object", + "required": [ + "path" + ], + "title": "ConceptSaveRequest", + "description": "Request body for the save-concept endpoint." + }, + "CurrentUnit": { + "type": "string", + "enum": [ + "A", + "mA", + "kA" + ], + "title": "CurrentUnit", + "description": "Current Unit." + }, + "DensityUnit": { + "type": "string", + "enum": [ + "kg/m\u00b3", + "g/cm\u00b3" + ], + "title": "DensityUnit", + "description": "Density Unit." + }, + "DriveCycleInput": { + "properties": { + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": {}, + "type": "array", + "title": "Points" + }, + "part_type": { + "type": "string", + "const": "drive_cycle", + "title": "Part Type", + "default": "drive_cycle" + }, + "drive_cycle_data_id": { + "type": "string", + "title": "Drive Cycle Data Id" + } + }, + "type": "object", + "required": [ + "drive_cycle_data_id" + ], + "title": "DriveCycleInput", + "description": "Drive Cycle Input.\n\nUpload the raw drive cycle data (CSV or JSON export from the solver) as a\nfile first, then create a ``DriveCycleInput`` referencing that file via\n``drive_cycle_data_id``. The ``points`` field is excluded from storage." + }, + "DriveCycleOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "drive_cycle", + "title": "Item Type", + "default": "drive_cycle" + }, + "name": { + "type": "string", + "title": "Name", + "default": "" + }, + "points": { + "items": {}, + "type": "array", + "title": "Points" + }, + "part_type": { + "type": "string", + "const": "drive_cycle", + "title": "Part Type", + "default": "drive_cycle" + }, + "drive_cycle_data_id": { + "type": "string", + "title": "Drive Cycle Data Id" + } + }, + "type": "object", + "required": [ + "id", + "drive_cycle_data_id" + ], + "title": "DriveCycleOutput", + "description": "Drive Cycle Output.\n\nThe raw time-series data (``points``) is stored in a separate file\nreferenced by ``drive_cycle_data_id``, mirroring the pattern used by\n:class:`~src.v2.models.components.MotorLabOutput`. The ``points`` field\nis excluded from the concept record so that large point arrays do not bloat\nthe concept JSON." + }, + "DriveCycleRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "title": "Drive Cycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementInput", + "description": "Drive Cycle Requirement Input." + }, + "DriveCycleRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Requirement" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "requirement_input_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Input Type", + "default": "drive_cycle" + }, + "requirement_type": { + "type": "string", + "const": "drive_cycle", + "title": "Requirement Type", + "default": "drive_cycle" + }, + "solver_id": { + "type": "integer", + "title": "Solver Id", + "default": -1 + }, + "drive_cycle": { + "title": "Drive Cycle" + }, + "range": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Range" + }, + "full_range_calculation": { + "type": "boolean", + "title": "Full Range Calculation", + "default": false + }, + "drive_cycle_id": { + "type": "string", + "title": "Drive Cycle Id" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id", + "drive_cycle_id" + ], + "title": "DriveCycleRequirementOutput", + "description": "Drive Cycle Requirement Output." + }, + "DynamicRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "requirement_input_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Input Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementInput", + "description": "Dynamic Requirement Input." + }, + "DynamicRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "D1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "thermal_analysis": { + "type": "boolean", + "title": "Thermal Analysis", + "default": false + }, + "shift_delta": { + "type": "number", + "title": "Shift Delta", + "default": 0 + }, + "stop_at_temperature_limit": { + "type": "boolean", + "title": "Stop At Temperature Limit", + "default": true + }, + "from_speed": { + "type": "number", + "title": "From Speed", + "default": 0 + }, + "to_speed": { + "type": "number", + "title": "To Speed", + "default": 1 + }, + "time_step": { + "type": "number", + "title": "Time Step", + "default": 0.1 + }, + "no_of_points": { + "type": "integer", + "title": "No Of Points", + "default": 6 + }, + "base_speed_ratio": { + "type": "number", + "title": "Base Speed Ratio", + "default": 0.5 + }, + "required_time": { + "type": "number", + "title": "Required Time", + "default": 10000000000.0 + }, + "required_distance": { + "type": "number", + "title": "Required Distance", + "default": 10000000000.0 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "max_capability": { + "type": "boolean", + "title": "Max Capability", + "default": false + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "requirement_input_type": { + "type": "string", + "const": "dynamic", + "title": "Requirement Input Type", + "default": "dynamic" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "DynamicRequirementOutput", + "description": "Dynamic Requirement Output." + }, + "Edge": { + "properties": { + "resistance": { + "type": "number", + "title": "Resistance" + }, + "connected_node_list": { + "items": {}, + "type": "array", + "title": "Connected Node List" + } + }, + "type": "object", + "required": [ + "resistance" + ], + "title": "Edge" + }, + "ElectricChargeUnit": { + "type": "string", + "enum": [ + "A\u00b7s" + ], + "title": "ElectricChargeUnit", + "description": "Unit of Electrical Charge." + }, + "ElectricalEnergyUnit": { + "type": "string", + "enum": [ + "J", + "kWh", + "VA\u00b7hr", + "Wh" + ], + "title": "ElectricalEnergyUnit", + "description": "Unit of Electrical Energy." + }, + "ElectricalPowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "VA", + "kVA" + ], + "title": "ElectricalPowerUnit", + "description": "Unit of Electrical Power." + }, + "EnergyUnit": { + "type": "string", + "enum": [ + "J", + "kJ", + "MJ", + "mJ", + "Wh", + "kWh" + ], + "title": "EnergyUnit", + "description": "Energy Unit." + }, + "FileInfo": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "path": { + "type": "string", + "title": "Path" + } + }, + "type": "object", + "required": [ + "id", + "path" + ], + "title": "FileInfo", + "description": "File data model." + }, + "FileItemCreateResponse": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + }, + "calculated_values": { + "additionalProperties": true, + "type": "object", + "title": "Calculated Values", + "default": {} + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemCreateResponse", + "description": "Response from creating a file item.\n\nIncludes any calculated values extracted from the file." + }, + "FileItemInput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemInput", + "description": "File Item Input \u2014 metadata supplied when registering a stored file." + }, + "FileItemOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "FileItemOutput", + "description": "File Item." + }, + "ForceUnit": { + "type": "string", + "enum": [ + "N", + "lbf", + "dyn" + ], + "title": "ForceUnit", + "description": "Force Unit." + }, + "FrequencyUnit": { + "type": "string", + "enum": [ + "Hz" + ], + "title": "FrequencyUnit", + "description": "Unit of frequency." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InertiaUnit": { + "type": "string", + "enum": [ + "kg\u00b7m\u00b2", + "g\u00b7mm\u00b2" + ], + "title": "InertiaUnit", + "description": "Inertia Unit." + }, + "JobOutput": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "id": { + "type": "string", + "title": "Id" + }, + "status": { + "type": "string", + "title": "Status" + }, + "files": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/FileInfo" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Files" + } + }, + "type": "object", + "required": [ + "name", + "id", + "status" + ], + "title": "JobOutput", + "description": "Job result data model." + }, + "JobRequest": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "requirement_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Requirement Ids" + }, + "architecture_id": { + "type": "string", + "title": "Architecture Id" + }, + "version": { + "type": "string", + "title": "Version", + "default": "latest" + } + }, + "type": "object", + "required": [ + "name", + "requirement_ids", + "architecture_id" + ], + "title": "JobRequest", + "description": "Request body for creating a job." + }, + "LengthUnit": { + "type": "string", + "enum": [ + "m", + "mm", + "cm", + "in", + "ft", + "yd", + "km", + "miles" + ], + "title": "LengthUnit", + "description": "Length Unit." + }, + "LossMapGridLab": { + "properties": { + "currents": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Currents" + }, + "phase_advances": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Phase Advances" + }, + "slips": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Slips" + }, + "losses_total": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses Total" + }, + "losses_iron": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses Iron" + } + }, + "type": "object", + "required": [ + "currents", + "phase_advances", + "slips", + "losses_total", + "losses_iron" + ], + "title": "LossMapGridLab", + "description": "Used for Lab motors if no efficiency map included in the .lab file.\n\nLosses for plotted with current/phase advance or current/slip." + }, + "LossMapGridPower": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Torques" + }, + "losses": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Losses" + }, + "efficiencies": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Efficiencies" + }, + "powers": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array", + "title": "Powers" + }, + "meta_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/LossMapGridPowerMetaData" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "speeds", + "torques", + "losses", + "efficiencies", + "powers" + ], + "title": "LossMapGridPower", + "description": "Power losses (e.g. motors)." + }, + "LossMapGridPowerMetaData": { + "properties": { + "voltage": { + "type": "number", + "title": "Voltage" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + }, + "current_limit_line_peak": { + "type": "number", + "title": "Current Limit Line Peak" + }, + "stator_temperature": { + "type": "number", + "title": "Stator Temperature" + }, + "rotor_temperature": { + "type": "number", + "title": "Rotor Temperature" + } + }, + "type": "object", + "required": [ + "voltage", + "control_strategy_bpm", + "control_strategy_sync", + "current_limit_line_peak", + "stator_temperature", + "rotor_temperature" + ], + "title": "LossMapGridPowerMetaData", + "description": "Meta-data for efficiency maps that have been calculated in Lab." + }, + "Mass": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + } + }, + "type": "object", + "title": "Mass", + "description": "Mass Configuration." + }, + "MassInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "MassInput", + "description": "Mass Input." + }, + "MassOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Mass Config" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 2000 + }, + "com_horizontal_offset": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Horizontal Offset" + }, + "com_vertical_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Com Vertical Height" + }, + "add_components_mass": { + "type": "boolean", + "title": "Add Components Mass", + "default": false + }, + "config_type": { + "type": "string", + "const": "mass", + "title": "Config Type", + "default": "mass" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "MassOutput", + "description": "Mass Output." + }, + "MassUnit": { + "type": "string", + "enum": [ + "kg", + "g", + "lb", + "oz", + "t", + "LT", + "tn" + ], + "title": "MassUnit", + "description": "Mass Unit." + }, + "MotorConfiguration": { + "properties": { + "component_config_type": { + "type": "string", + "const": "motor", + "title": "Component Config Type", + "default": "motor" + }, + "axle": { + "$ref": "#/components/schemas/ComponentAxle", + "default": "None" + }, + "state": { + "$ref": "#/components/schemas/MotorState", + "default": {} + } + }, + "type": "object", + "title": "MotorConfiguration", + "description": "Configuration that can change characteristics of the motor." + }, + "MotorLabData": { + "properties": { + "lab_file_dict": { + "additionalProperties": true, + "type": "object", + "title": "Lab File Dict" + }, + "component_file_type": { + "type": "string", + "const": "MotorLab", + "title": "Component File Type", + "default": "MotorLab" + } + }, + "type": "object", + "required": [ + "lab_file_dict" + ], + "title": "MotorLabData", + "description": "Motor Lab Data.\n\nModel is held as a dict, exported from Lab." + }, + "MotorLabInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/MotorLabData" + }, + { + "type": "null" + } + ] + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModel" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + }, + "lab_data_id": { + "type": "string", + "title": "Lab Data Id" + } + }, + "type": "object", + "required": [ + "max_speed", + "lab_data_id" + ], + "title": "MotorLabInput", + "description": "Motor Lab Input." + }, + "MotorLabOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Component Input" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "MotorLabModel", + "title": "Component Type", + "default": "MotorLabModel" + }, + "lab_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/MotorLabData" + }, + { + "type": "null" + } + ] + }, + "max_speed": { + "type": "number", + "title": "Max Speed" + }, + "flow_rate": { + "type": "number", + "title": "Flow Rate", + "default": 0 + }, + "state": { + "$ref": "#/components/schemas/MotorState" + }, + "thermal_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/ThermalModel" + }, + { + "type": "null" + } + ] + }, + "thermal_limits": { + "$ref": "#/components/schemas/MotorThermalLimits" + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + }, + "lab_data_id": { + "type": "string", + "title": "Lab Data Id" + } + }, + "type": "object", + "required": [ + "id", + "max_speed", + "lab_data_id" + ], + "title": "MotorLabOutput", + "description": "Motor Lab Output." + }, + "MotorState": { + "properties": { + "stator_winding_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp" + }, + "stator_winding_temp_peak": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Winding Temp Peak" + }, + "rotor_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor Temp" + }, + "stator_current_limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator Current Limit" + }, + "airgap_temp": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Airgap Temp" + }, + "bearing_temp_front": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Front" + }, + "bearing_temp_rear": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bearing Temp Rear" + }, + "control_strategy_bpm": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Bpm" + }, + "control_strategy_sync": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Control Strategy Sync" + } + }, + "type": "object", + "title": "MotorState", + "description": "Variables that define state of a motor.\n\nEssentially these are mostly all inputs to a Lab operating point calculation." + }, + "MotorThermalLimits": { + "properties": { + "stator": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Stator" + }, + "rotor": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Rotor" + }, + "stator_limit_type": { + "type": "string", + "title": "Stator Limit Type", + "default": "average" + } + }, + "type": "object", + "title": "MotorThermalLimits", + "description": "Thermal limits for motor components." + }, + "Node": { + "properties": { + "uid": { + "type": "integer", + "title": "Uid" + }, + "name": { + "type": "string", + "title": "Name" + }, + "capacitance": { + "type": "number", + "title": "Capacitance", + "default": 0 + }, + "fixed_temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Fixed Temperature" + } + }, + "type": "object", + "required": [ + "uid", + "name" + ], + "title": "Node" + }, + "PartType": { + "type": "string", + "enum": [ + "component", + "configuration", + "requirement", + "job", + "architecture", + "drive_cycle" + ], + "title": "PartType", + "description": "Part type enum." + }, + "PowerUnit": { + "type": "string", + "enum": [ + "W", + "kW", + "mW", + "MW", + "hp", + "hp" + ], + "title": "PowerUnit", + "description": "Power Unit." + }, + "PressureUnit": { + "type": "string", + "enum": [ + "Pa", + "kPa", + "MPa", + "psi" + ], + "title": "PressureUnit", + "description": "Pressure Unit." + }, + "RatioUnit": { + "type": "string", + "enum": [ + "", + "%" + ], + "title": "RatioUnit", + "description": "Ratio Unit." + }, + "ResistanceUnit": { + "type": "string", + "enum": [ + "ohm" + ], + "title": "ResistanceUnit", + "description": "Resistance Unit." + }, + "RoadEfficiencyUnit": { + "type": "string", + "enum": [ + "m/J", + "km/kWh", + "miles/kWh", + "MPGe" + ], + "title": "RoadEfficiencyUnit", + "description": "Unit of Road Efficiency." + }, + "SaveState": { + "type": "string", + "enum": [ + "unsaved", + "saved" + ], + "title": "SaveState", + "description": "Persistence state of a concept on the filesystem.\n\n``UNSAVED`` \u2014 concept was created in this session and has never been\nwritten to a user-chosen path (the default for new concepts).\n\n``SAVED`` \u2014 concept has been explicitly saved to a known path.\n\nExtending example: add ``MODIFIED`` here when tracking unsaved edits\nto an already-saved concept (\"dirty\" state)." + }, + "SpeedUnit": { + "type": "string", + "enum": [ + "m/s", + "km/hr", + "mph", + "ft/s" + ], + "title": "SpeedUnit", + "description": "Speed Unit." + }, + "StaticRequirementInput": { + "properties": { + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "speed": { + "type": "number", + "title": "Speed", + "default": 10 + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "requirement_input_type": { + "type": "string", + "const": "static", + "title": "Requirement Input Type", + "default": "static" + }, + "acceleration": { + "type": "number", + "title": "Acceleration", + "default": 1 + } + }, + "type": "object", + "required": [ + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "StaticRequirementInput", + "description": "Static Requirement (Acceleration) Input." + }, + "StaticRequirementOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "part_type": { + "type": "string", + "const": "requirement", + "title": "Part Type", + "default": "requirement" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + }, + "deceleration_limit_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deceleration Limit Id" + }, + "ancillary_load_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Ancillary Load Id" + }, + "item_type": { + "type": "string", + "const": "requirement", + "title": "Item Type", + "default": "requirement" + }, + "name": { + "type": "string", + "title": "Name", + "default": "S1" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "mass": { + "type": "null", + "title": "Mass" + }, + "aero": { + "type": "null", + "title": "Aero" + }, + "wheel": { + "type": "null", + "title": "Wheel" + }, + "deceleration_limit": { + "type": "null", + "title": "Deceleration Limit" + }, + "state_of_charge": { + "type": "number", + "title": "State Of Charge", + "default": 1 + }, + "component_configurations": { + "$ref": "#/components/schemas/ComponentConfigurationSet", + "default": { + "configurations": [] + } + }, + "ambient_temperature": { + "type": "number", + "title": "Ambient Temperature", + "default": 293.15 + }, + "ancillary_load": { + "type": "null", + "title": "Ancillary Load" + }, + "speed": { + "type": "number", + "title": "Speed" + }, + "altitude": { + "type": "number", + "title": "Altitude", + "default": 0 + }, + "headwind": { + "type": "number", + "title": "Headwind", + "default": 0 + }, + "gradient": { + "type": "number", + "title": "Gradient", + "default": 0 + }, + "front_axle_split": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Front Axle Split" + }, + "steady_state": { + "type": "boolean", + "title": "Steady State", + "default": false + }, + "requirement_input_type": { + "type": "string", + "const": "static", + "title": "Requirement Input Type", + "default": "static" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + } + }, + "type": "object", + "required": [ + "id", + "aero_id", + "mass_id", + "wheel_id", + "speed", + "acceleration" + ], + "title": "StaticRequirementOutput", + "description": "Static Requirement (Acceleration) Output." + }, + "SurfaceConditionTractionConfigs": { + "type": "string", + "enum": [ + "Snow", + "Wet", + "Dry" + ], + "title": "SurfaceConditionTractionConfigs", + "description": "Surface conditions that affect the traction coefficient." + }, + "TemperatureUnit": { + "type": "string", + "enum": [ + "K", + "\u00b0C", + "\u00b0F" + ], + "title": "TemperatureUnit", + "description": "Temperature Unit." + }, + "ThermalModel": { + "properties": { + "component_file_type": { + "type": "string", + "const": "ThermalModel", + "title": "Component File Type", + "default": "ThermalModel" + }, + "network": { + "$ref": "#/components/schemas/ThermalNetwork" + }, + "loss_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Loss Map" + }, + "temperature_map": { + "additionalProperties": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "object", + "title": "Temperature Map" + } + }, + "type": "object", + "required": [ + "network", + "loss_map", + "temperature_map" + ], + "title": "ThermalModel", + "description": "Thermal model.\n\nContains the thermal network defined by nodes and edges, and mappings of which nodes\ncorrespond to which losses and temperatures." + }, + "ThermalNetwork": { + "properties": { + "edges": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/Edge" + }, + "type": "array" + }, + "type": "object", + "title": "Edges" + }, + "nodes": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/Node" + }, + "type": "array" + }, + "type": "object", + "title": "Nodes" + }, + "speed_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Speed Dict" + }, + "flow_rate_dict": { + "additionalProperties": { + "type": "number" + }, + "type": "object", + "title": "Flow Rate Dict" + } + }, + "type": "object", + "required": [ + "edges", + "nodes", + "speed_dict", + "flow_rate_dict" + ], + "title": "ThermalNetwork", + "description": "Lumped parameter thermal network.\n\nIt is constructed from sets of nodes and edges (connections) at different speeds\nand flow rates.\n\nFields:\n speed_dict (dict): Dictionary mapping indices to speed values.\n flow_rate_dict (dict): Dictionary mapping indices to flow rate values.\n edges (dict): Dictionary mapping indices to edge lists.\n nodes (dict): Dictionary mapping indices to node lists." + }, + "TimeUnit": { + "type": "string", + "enum": [ + "s", + "ms", + "min", + "hr" + ], + "title": "TimeUnit", + "description": "Time Unit." + }, + "TorqueUnit": { + "type": "string", + "enum": [ + "N\u00b7m", + "ft\u00b7lbf", + "kN\u00b7m", + "MN\u00b7m", + "dyn\u00b7cm" + ], + "title": "TorqueUnit", + "description": "Torque Unit." + }, + "TotalTractiveTorqueGraphInput": { + "properties": { + "max_speed": { + "type": "number", + "exclusiveMinimum": 0.0, + "title": "Max Speed" + }, + "step_size_speed": { + "type": "number", + "exclusiveMinimum": 0.0, + "title": "Step Size Speed" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "mass": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mass" + }, + { + "type": "null" + } + ] + }, + "aero": { + "anyOf": [ + { + "$ref": "#/components/schemas/Aero" + }, + { + "type": "null" + } + ] + }, + "wheel": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelInput" + }, + { + "type": "null" + } + ] + }, + "altitude": { + "type": "number", + "title": "Altitude" + }, + "headwind": { + "type": "number", + "title": "Headwind" + }, + "gradient": { + "type": "number", + "title": "Gradient" + }, + "aero_id": { + "type": "string", + "title": "Aero Id" + }, + "mass_id": { + "type": "string", + "title": "Mass Id" + }, + "wheel_id": { + "type": "string", + "title": "Wheel Id" + } + }, + "type": "object", + "required": [ + "max_speed", + "step_size_speed", + "acceleration", + "altitude", + "headwind", + "gradient", + "aero_id", + "mass_id", + "wheel_id" + ], + "title": "TotalTractiveTorqueGraphInput", + "description": "Total Tractive Torque Graph Input." + }, + "TotalTractiveTorqueGraphOutput": { + "properties": { + "speeds": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Speeds" + }, + "acceleration": { + "type": "number", + "title": "Acceleration" + }, + "total_tractive_torques": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Torques" + }, + "aero_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Aero Forces" + }, + "mass_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Mass Forces" + }, + "total_forces": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Forces" + }, + "total_tractive_powers": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Total Tractive Powers" + } + }, + "type": "object", + "required": [ + "speeds", + "acceleration", + "total_tractive_torques", + "aero_forces", + "mass_forces", + "total_forces", + "total_tractive_powers" + ], + "title": "TotalTractiveTorqueGraphOutput", + "description": "Total Tractive Torque Graph Output." + }, + "TransmissionLossCoefficientsInput": { + "properties": { + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "title": "TransmissionLossCoefficientsInput", + "description": "Transmission Loss Coefficients Input." + }, + "TransmissionLossCoefficientsOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "component", + "title": "Item Type", + "default": "component" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Default Loss Coefficients Transmission" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "moment_of_inertia": { + "type": "number", + "title": "Moment Of Inertia", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "component_type": { + "type": "string", + "const": "TransmissionLossCoefficients", + "title": "Component Type", + "default": "TransmissionLossCoefficients" + }, + "gear_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Gear Ratios", + "default": [ + 1 + ] + }, + "headline_efficiencies": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Headline Efficiencies", + "default": [ + 1 + ] + }, + "max_torque": { + "type": "number", + "title": "Max Torque", + "default": 200 + }, + "max_speed": { + "type": "number", + "title": "Max Speed", + "default": 1047.1975499999983 + }, + "static_drags": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Static Drags", + "default": [ + 0 + ] + }, + "friction_ratios": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Friction Ratios", + "default": [ + 0.5 + ] + }, + "shift_time": { + "type": "number", + "title": "Shift Time", + "default": 0 + }, + "moment_of_inertia_wheel_side": { + "type": "number", + "title": "Moment Of Inertia Wheel Side", + "default": 0 + }, + "part_type": { + "type": "string", + "const": "component", + "title": "Part Type", + "default": "component" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "TransmissionLossCoefficientsOutput", + "description": "Transmission Loss Coefficients Output." + }, + "UnitChoices": { + "properties": { + "unit_type_to_unit_map": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/MassUnit" + }, + { + "$ref": "#/components/schemas/TimeUnit" + }, + { + "$ref": "#/components/schemas/ForceUnit" + }, + { + "$ref": "#/components/schemas/TorqueUnit" + }, + { + "$ref": "#/components/schemas/TemperatureUnit" + }, + { + "$ref": "#/components/schemas/LengthUnit" + }, + { + "$ref": "#/components/schemas/AreaUnit" + }, + { + "$ref": "#/components/schemas/VolumeUnit" + }, + { + "$ref": "#/components/schemas/SpeedUnit" + }, + { + "$ref": "#/components/schemas/AccelerationUnit" + }, + { + "$ref": "#/components/schemas/AngularSpeedUnit" + }, + { + "$ref": "#/components/schemas/AngularAccelerationUnit" + }, + { + "$ref": "#/components/schemas/EnergyUnit" + }, + { + "$ref": "#/components/schemas/PowerUnit" + }, + { + "$ref": "#/components/schemas/DensityUnit" + }, + { + "$ref": "#/components/schemas/InertiaUnit" + }, + { + "$ref": "#/components/schemas/PressureUnit" + }, + { + "$ref": "#/components/schemas/RatioUnit" + }, + { + "$ref": "#/components/schemas/VoltageUnit" + }, + { + "$ref": "#/components/schemas/CurrentUnit" + }, + { + "$ref": "#/components/schemas/ResistanceUnit" + }, + { + "$ref": "#/components/schemas/ElectricChargeUnit" + }, + { + "$ref": "#/components/schemas/ElectricalEnergyUnit" + }, + { + "$ref": "#/components/schemas/ElectricalPowerUnit" + }, + { + "$ref": "#/components/schemas/AngleUnit" + }, + { + "$ref": "#/components/schemas/RoadEfficiencyUnit" + }, + { + "$ref": "#/components/schemas/FrequencyUnit" + }, + { + "$ref": "#/components/schemas/VolumetricFlowRateUnit" + } + ] + }, + "type": "object", + "title": "Unit Type To Unit Map", + "default": { + "mass": "kg", + "time": "s", + "force": "N", + "torque": "N\u00b7m", + "temperature": "\u00b0C", + "length": "m", + "distance": "km", + "area": "m\u00b2", + "volume": "m\u00b3", + "speed": "km/hr", + "acceleration": "m/s\u00b2", + "angular_speed": "rpm", + "angular_acceleration": "rps/s", + "energy": "J", + "power": "kW", + "density": "kg/m\u00b3", + "inertia": "kg\u00b7m\u00b2", + "pressure": "Pa", + "ratio": "%", + "voltage": "V", + "current": "A", + "resistance": "ohm", + "electric_charge": "A\u00b7s", + "electrical_energy": "kWh", + "electrical_power": "kW", + "gradient": "deg", + "road_efficiency": "km/kWh", + "frequency": "Hz", + "volumetric_flow_rate": "l/min" + } + } + }, + "type": "object", + "title": "UnitChoices", + "description": "Unit Choice for the analysis.\n\nWe might not need all of these.\nWe might want to create preset groups of these (eg. MKS, Imperial etc)" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "VoltageUnit": { + "type": "string", + "enum": [ + "V", + "mV", + "kV" + ], + "title": "VoltageUnit", + "description": "Voltage Unit." + }, + "VolumeUnit": { + "type": "string", + "enum": [ + "m\u00b3", + "mm\u00b3", + "cm\u00b3", + "in\u00b3", + "ft\u00b3", + "yd\u00b3", + "l", + "ml", + "cc" + ], + "title": "VolumeUnit", + "description": "Volume Unit." + }, + "VolumetricFlowRateUnit": { + "type": "string", + "enum": [ + "m\u00b3/s", + "m\u00b3/min", + "l/s", + "l/min" + ], + "title": "VolumetricFlowRateUnit", + "description": "Unit of volumetric flow rate." + }, + "WheelInput": { + "properties": { + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "title": "WheelInput", + "description": "Wheel Input." + }, + "WheelOutput": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "item_type": { + "type": "string", + "const": "config", + "title": "Item Type", + "default": "config" + }, + "name": { + "type": "string", + "title": "Name", + "default": "Wheel" + }, + "mass": { + "type": "number", + "title": "Mass", + "default": 0 + }, + "cost": { + "type": "number", + "title": "Cost", + "default": 0 + }, + "rolling_radius": { + "type": "number", + "title": "Rolling Radius", + "default": 0.3 + }, + "rolling_resistance_coefficient": { + "type": "number", + "title": "Rolling Resistance Coefficient", + "default": 0.02 + }, + "rolling_resistance_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/WheelRollingResistanceConfigs" + }, + { + "type": "null" + } + ] + }, + "traction_coefficient": { + "type": "number", + "title": "Traction Coefficient", + "default": 0.9 + }, + "traction_coefficient_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/SurfaceConditionTractionConfigs" + }, + { + "type": "null" + } + ] + }, + "config_type": { + "type": "string", + "const": "wheel", + "title": "Config Type", + "default": "wheel" + }, + "part_type": { + "type": "string", + "const": "configuration", + "title": "Part Type", + "default": "configuration" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "WheelOutput", + "description": "Wheel Output." + }, + "WheelRollingResistanceConfigs": { + "type": "string", + "enum": [ + "Car on asphalt", + "Car on concrete", + "Car on gravel" + ], + "title": "WheelRollingResistanceConfigs", + "description": "Condition on wheels which affect the rolling resistance coefficient." + } + }, + "securitySchemes": { + "APIKeyHeader": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "servers": [ + { + "url": "/api" + } + ] +} \ No newline at end of file diff --git a/scripts/export_openapi.py b/scripts/export_openapi.py new file mode 100644 index 00000000..80c3aca2 --- /dev/null +++ b/scripts/export_openapi.py @@ -0,0 +1,66 @@ +"""Export the ConceptEV OpenAPI spec from the service URL to a JSON file. + +Run from the repo root inside the poetry/venv environment: + + python scripts/export_openapi.py [--output schema/openapi_v2.json] + python scripts/export_openapi.py --url https://dev-conceptev.awsansys3np.onscale.com/api/openapi.json + +The script fetches the OpenAPI document from the configured service URL and +writes it to disk. +""" + +import argparse +import json +from pathlib import Path + +import httpx + +# DEFAULT_OPENAPI_URL = "https://dev-conceptev.awsansys3np.onscale.com/api/openapi.json" +DEFAULT_OPENAPI_URL = "http://127.0.0.1:8080/api/openapi.json" + + +def fetch_spec(url: str) -> dict: + """Fetch and return the OpenAPI spec from the given URL.""" + with httpx.Client(follow_redirects=True, timeout=60.0) as client: + response = client.get(url) + response.raise_for_status() + + spec = response.json() + if not isinstance(spec, dict): + raise ValueError(f"Expected a JSON object from {url}, got {type(spec).__name__}") + + return spec + + +def main() -> None: + """Parse args and export the spec.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--url", + default=DEFAULT_OPENAPI_URL, + help=f"OpenAPI URL to fetch (default: {DEFAULT_OPENAPI_URL})", + ) + parser.add_argument( + "--output", + default="schema/openapi_v2.json", + help="Output path for the OpenAPI JSON file (default: schema/openapi_v2.json)", + ) + args = parser.parse_args() + + output_path = Path(args.output) + output_path.parent.mkdir(parents=True, exist_ok=True) + + print(f"Fetching OpenAPI spec from {args.url}...") + spec = fetch_spec(args.url) + + path_count = len(spec.get("paths", {})) + schema_count = len(spec.get("components", {}).get("schemas", {})) + + with output_path.open("w", encoding="utf-8") as f: + json.dump(spec, f, indent=2) + + print(f"Exported {path_count} paths, {schema_count} schemas -> {output_path}") + + +if __name__ == "__main__": + main() diff --git a/scripts/generate_client.py b/scripts/generate_client.py new file mode 100644 index 00000000..74927a12 --- /dev/null +++ b/scripts/generate_client.py @@ -0,0 +1,158 @@ +"""Generate the pyconceptev Python client from the ConceptEV v2 OpenAPI spec. + +Pipeline (all steps run automatically unless flags are used): + 1. Export the spec from the configured OpenAPI URL -> schema/openapi_v2.json + 2. Patch the spec to fix any generator-incompatibilities (safety-net) + 3. Run openapi-python-client to generate the typed client + +Usage (from repo root, inside poetry/venv environment): + + # Full pipeline: + python scripts/generate_client.py + + # Skip export, use existing spec file: + python scripts/generate_client.py --no-export + + # Use a custom spec file (also skips export): + python scripts/generate_client.py --spec path/to/openapi.json --no-export + +The generated client is written to schema/generated_client/. +""" + +import argparse +from datetime import datetime, timezone +import json +from pathlib import Path +import shutil +import subprocess +import sys + +REPO_ROOT = Path(__file__).parents[1] +DEFAULT_SPEC = REPO_ROOT / "schema" / "openapi_v2.json" +DEFAULT_OUTPUT = REPO_ROOT / "schema" / "generated_client" +OPC_CONFIG = REPO_ROOT / "schema" / "opc_config.yaml" +GENERATED_PKG_NAME = "conceptev_api_client" +SRC_DEST = REPO_ROOT / "src" / "ansys" / "conceptev" / "core" / "generated" + + +def export_spec(output: Path) -> None: + """Run the spec-export script.""" + print("==> Exporting OpenAPI v2 spec...") + subprocess.run( + [sys.executable, str(REPO_ROOT / "scripts" / "export_openapi.py"), "--output", str(output)], + check=True, + ) + + +def patch_spec(spec: Path) -> None: + """Run the spec-patch script (fixes generator-incompatibilities).""" + print("==> Patching spec...") + subprocess.run( + [sys.executable, str(REPO_ROOT / "scripts" / "patch_openapi.py"), "--input", str(spec)], + check=True, + ) + + +def generate_client(spec: Path, output: Path, config: Path) -> None: + """Run openapi-python-client generator.""" + print(f"==> Generating client from {spec}...") + cmd = [ + sys.executable, + "-m", + "openapi_python_client", + "generate", + "--path", + str(spec), + "--output-path", + str(output), + "--config", + str(config), + "--overwrite", + ] + subprocess.run(cmd, check=True) + + print(f"==> Client generated at {output}") + + +def copy_to_src(generated_output: Path, dest: Path, spec: Path) -> None: + """Copy the generated package into the src tree so it is part of the installed package.""" + src = generated_output / GENERATED_PKG_NAME + if not src.is_dir(): + print(f"ERROR: Generated package not found at {src}", file=sys.stderr) + sys.exit(1) + print(f"==> Copying {src.name} -> {dest}...") + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(src, dest) + + # Write a stamp file recording which spec version produced this code. + spec_version = "unknown" + try: + spec_version = json.loads(spec.read_text(encoding="utf-8"))["info"]["version"] + except Exception: + pass + stamp = dest / "_codegen_stamp.py" + stamp.write_text( + f'"""Auto-generated marker — do not edit manually.\n\n' + f"Regenerate with: python scripts/generate_client.py\n" + f'"""\n\n' + f'SPEC_VERSION = "{spec_version}"\n' + f'GENERATED_AT = "{datetime.now(timezone.utc).isoformat(timespec="seconds")}"\n', + encoding="utf-8", + ) + + +def main() -> None: + """Parse args and run the generation pipeline.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--spec", + default=str(DEFAULT_SPEC), + help=f"Path to OpenAPI spec JSON (default: {DEFAULT_SPEC})", + ) + parser.add_argument( + "--output", + default=str(DEFAULT_OUTPUT), + help=f"Output directory for generated client (default: {DEFAULT_OUTPUT})", + ) + parser.add_argument( + "--no-export", + action="store_true", + help="Skip spec export step and use the existing spec file", + ) + parser.add_argument( + "--no-patch", + action="store_true", + help="Skip the spec-patch step (use only if spec is already clean)", + ) + parser.add_argument( + "--no-copy", + action="store_true", + help="Skip copying the generated package into src/ansys/conceptev/core/generated/", + ) + args = parser.parse_args() + + spec_path = Path(args.spec) + output_path = Path(args.output) + + if not args.no_export: + export_spec(spec_path) + elif not spec_path.exists(): + print(f"ERROR: Spec file not found: {spec_path}", file=sys.stderr) + sys.exit(1) + + if not args.no_patch: + patch_spec(spec_path) + + if not OPC_CONFIG.exists(): + print(f"ERROR: Generator config not found: {OPC_CONFIG}", file=sys.stderr) + sys.exit(1) + + generate_client(spec_path, output_path, OPC_CONFIG) + + if not args.no_copy: + copy_to_src(output_path, SRC_DEST, spec_path) + + +if __name__ == "__main__": + main() diff --git a/scripts/patch_openapi.py b/scripts/patch_openapi.py new file mode 100644 index 00000000..7077687e --- /dev/null +++ b/scripts/patch_openapi.py @@ -0,0 +1,196 @@ +"""Patch a ConceptEV OpenAPI spec to fix known generator-incompatibilities. + +This script is a CI safety-net that fixes issues in the spec before passing it +to openapi-python-client. The root causes should be fixed in the server code; +this script exists so client generation doesn't break while those fixes land. + +Known issues patched: + 1. discriminator.mapping values that are nested schemas (not $ref strings) + — caused by LibraryItemTypes union with sub-discriminators. + 2. Path parameters typed as ``str | null`` (None | str) + — invalid in OpenAPI 3.1 path params; generator rejects the endpoint. + +Usage: + python scripts/patch_openapi.py --input schema/openapi_v2.json + python scripts/patch_openapi.py --input schema/openapi_v2.json --output schema/openapi_v2_patched.json +""" + +import argparse +import copy +import json +from pathlib import Path +import sys + + +def fix_bad_discriminator_mappings(spec: dict) -> list[str]: + """Remove discriminator.mapping entries whose values are dicts (not strings). + + The OpenAPI 3.x spec requires that discriminator.mapping values are strings + ($ref paths or schema names). FastAPI can emit dict values when a union + type itself contains a discriminator — openapi-python-client rejects these. + + Returns a list of human-readable descriptions of changes made. + """ + changes: list[str] = [] + + def _fix(obj: object, path: str) -> None: + if isinstance(obj, dict): + if "discriminator" in obj: + mapping: dict = obj["discriminator"].get("mapping", {}) + bad = [k for k, v in mapping.items() if isinstance(v, dict)] + for k in bad: + del mapping[k] + changes.append(f"Removed non-string discriminator mapping key '{k}' at {path}") + if not mapping: + del obj["discriminator"] + for k, v in obj.items(): + _fix(v, f"{path}.{k}") + elif isinstance(obj, list): + for i, v in enumerate(obj): + _fix(v, f"{path}[{i}]") + + _fix(spec.get("paths", {}), "paths") + return changes + + +def fix_nullable_path_params(spec: dict) -> list[str]: + """Remove endpoints whose path parameters are typed as nullable (str | null). + + openapi-python-client does not support ``None | str`` path parameters. + These are typically on deprecated endpoints; they are removed from the spec + so the generator skips them cleanly rather than emitting a warning/error. + + Returns a list of human-readable descriptions of changes made. + """ + changes: list[str] = [] + paths_to_remove: list[str] = [] + + for path, path_item in spec.get("paths", {}).items(): + for method, op in path_item.items(): + if not isinstance(op, dict): + continue + for param in op.get("parameters", []): + if param.get("in") != "path": + continue + schema = param.get("param_schema") or param.get("schema", {}) + any_of = schema.get("anyOf", []) + types = {s.get("type") for s in any_of} + if "null" in types and len(any_of) > 1: + paths_to_remove.append(path) + changes.append( + f"Removed {method.upper()} {path}: " + f"path param '{param.get('name')}' is nullable (str|null)" + ) + + for path in paths_to_remove: + del spec["paths"][path] + + return changes + + +def prune_unused_schemas(spec: dict) -> list[str]: + """Remove schemas not reachable from any path. Returns removed schema names.""" + components = spec.get("components", {}) + all_schemas: dict = components.get("schemas", {}) + if not all_schemas: + return [] + + def _collect_refs(obj: object, refs: set[str]) -> None: + if isinstance(obj, dict): + if "$ref" in obj and isinstance(obj["$ref"], str): + refs.add(obj["$ref"]) + for v in obj.values(): + _collect_refs(v, refs) + elif isinstance(obj, list): + for v in obj: + _collect_refs(v, refs) + + reachable: set[str] = set() + frontier: set[str] = set() + _collect_refs(spec.get("paths", {}), frontier) + + while frontier: + new_refs: set[str] = set() + for ref in frontier: + name = ref.split("/")[-1] + if name in reachable: + continue + reachable.add(name) + if name in all_schemas: + _collect_refs(all_schemas[name], new_refs) + frontier = new_refs - reachable + + removed = [k for k in all_schemas if k not in reachable] + spec["components"]["schemas"] = {k: v for k, v in all_schemas.items() if k in reachable} + return removed + + +def patch(spec: dict, *, prune_schemas: bool = False) -> tuple[dict, list[str]]: + """Apply all patches to *spec* (in-place on a deep copy). + + Returns ``(patched_spec, list_of_change_descriptions)``. + """ + patched = copy.deepcopy(spec) + all_changes: list[str] = [] + + changes = fix_bad_discriminator_mappings(patched) + all_changes.extend(changes) + + changes = fix_nullable_path_params(patched) + all_changes.extend(changes) + + if prune_schemas: + removed = prune_unused_schemas(patched) + if removed: + all_changes.append( + f"Pruned {len(removed)} unused schemas: {', '.join(removed[:5])}{'...' if len(removed) > 5 else ''}" + ) + + return patched, all_changes + + +def main() -> None: + """Parse args and patch the spec.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--input", required=True, help="Input OpenAPI JSON file") + parser.add_argument( + "--output", + help="Output path (defaults to overwriting input file)", + ) + parser.add_argument( + "--prune-schemas", + action="store_true", + help="Also remove schemas not reachable from any path", + ) + parser.add_argument( + "--check", + action="store_true", + help="Exit with code 1 if any patches were applied (for CI diff checks)", + ) + args = parser.parse_args() + + input_path = Path(args.input) + if not input_path.exists(): + print(f"ERROR: Input file not found: {input_path}", file=sys.stderr) + sys.exit(1) + + spec = json.loads(input_path.read_text(encoding="utf-8")) + patched, changes = patch(spec, prune_schemas=args.prune_schemas) + + output_path = Path(args.output) if args.output else input_path + output_path.write_text(json.dumps(patched, indent=2), encoding="utf-8") + + if changes: + print(f"Applied {len(changes)} patch(es) to {output_path}:") + for c in changes: + print(f" - {c}") + else: + print(f"No patches needed — spec at {output_path} is already clean.") + + if args.check and changes: + print("\nCI check failed: spec required patches. Fix the root causes in the server code.") + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/src/ansys/conceptev/core/app.py b/src/ansys/conceptev/core/app.py index 8196fdfd..9fb1128d 100644 --- a/src/ansys/conceptev/core/app.py +++ b/src/ansys/conceptev/core/app.py @@ -22,7 +22,7 @@ """Simple API client for the Ansys ConceptEV service.""" import datetime -from typing import Literal +from typing import TYPE_CHECKING, Literal import httpx from tenacity import retry, retry_if_result, stop_after_delay, wait_random_exponential @@ -53,6 +53,9 @@ from ansys.conceptev.core.responses import is_gateway_error, process_response from ansys.conceptev.core.settings import settings +if TYPE_CHECKING: + import ansys.conceptev.core.generated as generated_client + __all__ = [ "get_or_create_project", "create_new_project", @@ -72,6 +75,9 @@ "get_project_id", "delete_project", "get_token", + "get_http_client", + "get_conceptev_client", + "get_local_client", ] Router = Literal[ @@ -141,6 +147,85 @@ def get_http_client( return client +def get_local_client( + base_url: str = "http://127.0.0.1:8080/api", +) -> "generated_client.Client": + """Get a generated API client pointed at a local ConceptEV server. + + No authentication is performed — intended for use with a locally running + instance of the ConceptEV service (e.g. ``http://127.0.0.1:8080/api``). + + Use it with the generated v2 API modules:: + + from ansys.conceptev.core.app import get_local_client + from ansys.conceptev.core.generated.api.concept_v2 import ( + create_concept_v2_concept_post, + ) + from ansys.conceptev.core.generated.models import ConceptInput + + with get_local_client() as client: + concept = create_concept_v2_concept_post.sync( + client=client, body=ConceptInput(name="My Study") + ) + + Args: + base_url: Base URL of the local ConceptEV API. + + Returns: + A :class:`~ansys.conceptev.core.generated.client.Client` ready for use + with all generated v2 API modules. + """ + from ansys.conceptev.core.generated.client import Client as _OpcClient # noqa: PLC0415 + + return _OpcClient(base_url=base_url) + + +def get_conceptev_client( + token: str | None = None, + cache_filepath: str = "token_cache.bin", +) -> "generated_client.Client": + """Get a ConceptEV generated API client with auth and retry logic embedded. + + The returned client is a ``conceptev_api_client.Client`` whose underlying + ``httpx.Client`` is pre-configured with: + + * **AnsysID auth** (MSAL token acquire + automatic refresh on 401) + * **Tenacity retry** on gateway errors (502 / 504) + * **SSL context** from :func:`~ansys.conceptev.core.progress.generate_ssl_context` + + Use it together with the generated API modules:: + + from ansys.conceptev.core.app import get_conceptev_client + from ansys.conceptev.core.generated.api.concepts import ( + create_concept_check_concepts_post, + ) + + with get_conceptev_client() as client: + concept = create_concept_check_concepts_post.sync( + client=client, body=..., design_instance_id="..." + ) + + Args: + token: A pre-acquired bearer token. When *None* the client obtains + and refreshes tokens automatically via MSAL. + cache_filepath: Path for the MSAL persistent token cache. + + Returns: + A :class:`~ansys.conceptev.core.generated.client.Client` ready for use + with all generated API modules. + """ + from ansys.conceptev.core.generated.client import Client as _OpcClient # noqa: PLC0415 + + # Reuse the existing httpx.Client factory — it carries AnsysIDAuth + retry. + httpx_client = get_http_client(token=token, cache_filepath=cache_filepath) + + # Inject the pre-configured httpx.Client into the generated OPC Client so + # every generated API call automatically inherits auth and retry behaviour. + opc_client = _OpcClient(base_url=BASE_URL) + opc_client.set_httpx_client(httpx_client) + return opc_client + + def get( client: httpx.Client, router: Router, id: str | None = None, params: dict | None = None ) -> dict: @@ -397,7 +482,7 @@ def get_results( def get_component_id_map(client, design_instance_id): """Get a map of component name to component id.""" - ###TODO move to results file so its self contained. + # TODO: move to results file so it's self-contained. components = client.get(f"/concepts/{design_instance_id}/components") components = process_response(components) components.append({"name": "N/A", "id": None}) diff --git a/src/ansys/conceptev/core/auth.py b/src/ansys/conceptev/core/auth.py index 6d1cb30a..a8f16a8c 100644 --- a/src/ansys/conceptev/core/auth.py +++ b/src/ansys/conceptev/core/auth.py @@ -51,7 +51,7 @@ def build_persistence(location, fallback_to_plaintext=True): """Create Persistent Cache.""" try: return build_encrypted_persistence(location) - except: + except Exception: if not fallback_to_plaintext: raise logger.exception("Encryption unavailable. Opting in to plain text.") diff --git a/src/ansys/conceptev/core/generated/__init__.py b/src/ansys/conceptev/core/generated/__init__.py new file mode 100644 index 00000000..3943d584 --- /dev/null +++ b/src/ansys/conceptev/core/generated/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing ConceptEV-API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/src/ansys/conceptev/core/generated/_codegen_stamp.py b/src/ansys/conceptev/core/generated/_codegen_stamp.py new file mode 100644 index 00000000..d156bf86 --- /dev/null +++ b/src/ansys/conceptev/core/generated/_codegen_stamp.py @@ -0,0 +1,7 @@ +"""Auto-generated marker — do not edit manually. + +Regenerate with: python scripts/generate_client.py +""" + +SPEC_VERSION = "0.2.158" +GENERATED_AT = "2026-06-04T15:58:24+00:00" diff --git a/src/ansys/conceptev/core/generated/api/__init__.py b/src/ansys/conceptev/core/generated/api/__init__.py new file mode 100644 index 00000000..81f9fa24 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/__init__.py b/src/ansys/conceptev/core/generated/api/concept_v2/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/calculate_total_forces.py b/src/ansys/conceptev/core/generated/api/concept_v2/calculate_total_forces.py new file mode 100644 index 00000000..59800b1f --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/calculate_total_forces.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.total_tractive_torque_graph_input import TotalTractiveTorqueGraphInput +from ...models.total_tractive_torque_graph_output import TotalTractiveTorqueGraphOutput +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: TotalTractiveTorqueGraphInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}:calculate_forces".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | TotalTractiveTorqueGraphOutput | None: + if response.status_code == 200: + response_200 = TotalTractiveTorqueGraphOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | TotalTractiveTorqueGraphOutput] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Any | TotalTractiveTorqueGraphOutput | None: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | TotalTractiveTorqueGraphOutput + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Response[Any | TotalTractiveTorqueGraphOutput]: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | TotalTractiveTorqueGraphOutput] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: TotalTractiveTorqueGraphInput, +) -> Any | TotalTractiveTorqueGraphOutput | None: + """Calculate Total Forces + + Calculate the total tractive torque. + + Args: + id (str): + body (TotalTractiveTorqueGraphInput): Total Tractive Torque Graph Input. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | TotalTractiveTorqueGraphOutput + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/check_job_backend_availability.py b/src/ansys/conceptev/core/generated/api/concept_v2/check_job_backend_availability.py new file mode 100644 index 00000000..a23e8021 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/check_job_backend_availability.py @@ -0,0 +1,202 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.check_job_backend_availability_response_check_job_backend_availability import ( + CheckJobBackendAvailabilityResponseCheckJobBackendAvailability, +) +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/availability".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + if response.status_code == 200: + response_200 = CheckJobBackendAvailabilityResponseCheckJobBackendAvailability.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = cast(Any, None) + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError +]: + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + Any + | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability + | HTTPValidationError + | None +): + """Check Job Backend Availability + + Check if job backend is available. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | CheckJobBackendAvailabilityResponseCheckJobBackendAvailability | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/create_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/create_concept.py new file mode 100644 index 00000000..8692803f --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/create_concept.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_input import ConceptInput +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + *, + body: ConceptInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ConceptOutput | HTTPValidationError | None: + if response.status_code == 201: + response_201 = ConceptOutput.from_dict(response.json()) + + return response_201 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[ConceptOutput | HTTPValidationError]: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> ConceptOutput | HTTPValidationError | None: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[ConceptOutput | HTTPValidationError]: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> ConceptOutput | HTTPValidationError | None: + """Create Concept + + Create a new concept in the database. + + Args: + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/create_concept_part.py b/src/ansys/conceptev/core/generated/api/concept_v2/create_concept_part.py new file mode 100644 index 00000000..7650d007 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/create_concept_part.py @@ -0,0 +1,539 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_input import AeroInput +from ...models.aero_output import AeroOutput +from ...models.architecture_input import ArchitectureInput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_input import BatteryFixedVoltagesInput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_input import BatteryLookupTableInput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_input import DriveCycleInput +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_input import DriveCycleRequirementInput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_input import DynamicRequirementInput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.mass_input import MassInput +from ...models.mass_output import MassOutput +from ...models.motor_lab_input import MotorLabInput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_input import StaticRequirementInput +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_input import WheelInput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + *, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/{part_type}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + ), + } + + if isinstance(body, MotorLabInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryFixedVoltagesInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryLookupTableInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, TransmissionLossCoefficientsInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, AeroInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, MassInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, WheelInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, ArchitectureInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DriveCycleRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DynamicRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, StaticRequirementInput): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + if response.status_code == 201: + + def _parse_response_201( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_201_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_201_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_201_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_201_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_0 = AeroOutput.from_dict(data) + + return response_201_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_1 = MassOutput.from_dict(data) + + return response_201_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_1_type_2 = WheelOutput.from_dict(data) + + return response_201_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_2 = ArchitectureOutput.from_dict(data) + + return response_201_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_201_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_201_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_201_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_201_type_4 = DriveCycleOutput.from_dict(data) + + return response_201_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_201_type_5 = ConceptJobRecord.from_dict(data) + + return response_201_type_5 + + response_201 = _parse_response_201(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return sync_detailed( + id=id, + part_type=part_type, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Create Concept Part + + Create a new part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/create_file_item.py b/src/ansys/conceptev/core/generated/api/concept_v2/create_file_item.py new file mode 100644 index 00000000..d2a731d7 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/create_file_item.py @@ -0,0 +1,232 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_create_file_item import BodyCreateFileItem +from ...models.component_file_type import ComponentFileType +from ...models.file_item_create_response import FileItemCreateResponse +from ...types import UNSET, Response + + +def _get_kwargs( + id: str, + *, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["name"] = name + + json_component_file_type: str = component_file_type + params["component_file_type"] = json_component_file_type + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/files".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + # Use the caller-supplied name as the multipart filename so FastAPI + # receives a proper UploadFile rather than a plain string field. + _kwargs["files"] = [("file", (name, body.file.encode("latin-1"), "application/octet-stream"))] + + # Do NOT set Content-Type manually — httpx generates the correct + # multipart boundary automatically when `files` is present. + if headers: + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemCreateResponse | None: + if response.status_code == 201: + response_201 = FileItemCreateResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemCreateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Response[Any | FileItemCreateResponse]: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemCreateResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + name=name, + component_file_type=component_file_type, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Any | FileItemCreateResponse | None: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemCreateResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + name=name, + component_file_type=component_file_type, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Response[Any | FileItemCreateResponse]: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemCreateResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + name=name, + component_file_type=component_file_type, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: BodyCreateFileItem, + name: str, + component_file_type: ComponentFileType, +) -> Any | FileItemCreateResponse | None: + """Create File + + Upload a new file for a concept. + + Args: + id (str): + name (str): + component_file_type (ComponentFileType): Types of files. + body (BodyCreateFileItem): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemCreateResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + name=name, + component_file_type=component_file_type, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/create_job.py b/src/ansys/conceptev/core/generated/api/concept_v2/create_job.py new file mode 100644 index 00000000..45361dbc --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/create_job.py @@ -0,0 +1,216 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_job_record import ConceptJobRecord +from ...models.job_request import JobRequest +from ...types import Response + + +def _get_kwargs( + concept_id: str, + *, + body: JobRequest, +) -> dict[str, Any]: + from ...types import UNSET + + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{concept_id}/job".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + # The v2 endpoint requires account_id as a query parameter; mirror it from the body. + if body.account_id is not UNSET and body.account_id is not None: + _kwargs["params"] = {"account_id": body.account_id} + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptJobRecord | None: + if response.status_code == 200: + response_200 = ConceptJobRecord.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptJobRecord]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Response[Any | ConceptJobRecord]: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. Set + ``body.account_id`` to pass the account ID in the request body. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptJobRecord] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Any | ConceptJobRecord | None: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. Set + ``body.account_id`` to pass the account ID in the request body. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptJobRecord + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Response[Any | ConceptJobRecord]: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptJobRecord] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, + body: JobRequest, +) -> Any | ConceptJobRecord | None: + """Create Job + + Create a new requirement job. + + Stores an initial RUNNING ConceptJobRecord in the concept immediately + (as a PartType.JOB part), then updates it with the output URL once the + solver finishes. Returns the stored record so the caller has the part id. + + Args: + concept_id (str): + body (JobRequest): Request body for creating a job. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptJobRecord + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept.py new file mode 100644 index 00000000..64cd6350 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept.py @@ -0,0 +1,171 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept + + Delete a concept from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept_part.py b/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept_part.py new file mode 100644 index 00000000..37242366 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/delete_concept_part.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.part_type import PartType +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Concept Part + + Delete a part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/delete_file_item.py b/src/ansys/conceptev/core/generated/api/concept_v2/delete_file_item.py new file mode 100644 index 00000000..6c6aa9ea --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/delete_file_item.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete File + + Delete a file from a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/delete_job.py b/src/ansys/conceptev/core/generated/api/concept_v2/delete_job.py new file mode 100644 index 00000000..89babed0 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/delete_job.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v2/concept/{concept_id}/job/{job_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Job + + Delete a job from the backend. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_component_display_data.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_component_display_data.py new file mode 100644 index 00000000..886faea7 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_component_display_data.py @@ -0,0 +1,310 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_loss_map_args import ComponentLossMapArgs +from ...models.loss_map_grid_lab import LossMapGridLab +from ...models.loss_map_grid_power import LossMapGridPower +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + part_id: str, + *, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/component/{part_id}:get_display_data".format( + id=quote(str(id), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + if isinstance(body, ComponentLossMapArgs): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + if response.status_code == 200: + + def _parse_response_200(data: object) -> Any | LossMapGridLab | LossMapGridPower: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0 = LossMapGridLab.from_dict(data) + + return response_200_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1 = LossMapGridPower.from_dict(data) + + return response_200_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Any | LossMapGridLab | LossMapGridPower, data) + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Any | LossMapGridLab | LossMapGridPower] + """ + + kwargs = _get_kwargs( + id=id, + part_id=part_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Any | LossMapGridLab | LossMapGridPower + """ + + return sync_detailed( + id=id, + part_id=part_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Response[Any | Any | LossMapGridLab | LossMapGridPower]: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Any | LossMapGridLab | LossMapGridPower] + """ + + kwargs = _get_kwargs( + id=id, + part_id=part_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLossMapArgs | None | Unset = UNSET, +) -> Any | Any | LossMapGridLab | LossMapGridPower | None: + """Get Display Data + + Get graph data for a component. + + Supported component types: + + - **MotorLab** — returns ``LossMapGridLab`` or ``LossMapGridPower`` + - **BatteryLookupTable** — returns ``BatteryLookupTableData`` + - **TransmissionLossCoefficients** — returns ``LossMapGridTorque`` + + Args: + id: The concept ID. + part_id: The component part ID. + database: Injected database dependency. + unit_choices: Injected unit-choice dependency. + extra_args: Optional loss-map calculation arguments (speed, voltage…). + + Returns: + A display-data object in user units. + + Raises: + HTTPException 404: If the component or its associated file is not found. + HTTPException 422: If the component type does not support display data. + + Args: + id (str): + part_id (str): + body (ComponentLossMapArgs | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Any | LossMapGridLab | LossMapGridPower + """ + + return ( + await asyncio_detailed( + id=id, + part_id=part_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_concept.py new file mode 100644 index 00000000..9b1dbdfd --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_concept.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Get Concept + + Get a concept by ID from the database. + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_concept_part.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_concept_part.py new file mode 100644 index 00000000..4d53868c --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_concept_part.py @@ -0,0 +1,433 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_output import AeroOutput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.http_validation_error import HTTPValidationError +from ...models.mass_output import MassOutput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + if response.status_code == 200: + + def _parse_response_200( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_200_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_200_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_200_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_200_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_0 = AeroOutput.from_dict(data) + + return response_200_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_1 = MassOutput.from_dict(data) + + return response_200_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_2 = WheelOutput.from_dict(data) + + return response_200_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_2 = ArchitectureOutput.from_dict(data) + + return response_200_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_200_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_200_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_200_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_4 = DriveCycleOutput.from_dict(data) + + return response_200_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_5 = ConceptJobRecord.from_dict(data) + + return response_200_type_5 + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError +]: + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | HTTPValidationError + | None +): + """Get Concept Part + + Get a specific part from a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_file_item.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_file_item.py new file mode 100644 index 00000000..c883558a --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_file_item.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_item_output import FileItemOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = FileItemOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Get File + + Get file metadata for a concept. + + Args: + id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_job.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_job.py new file mode 100644 index 00000000..47a1cb85 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_job.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.job_output import JobOutput +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/{job_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | JobOutput | None: + if response.status_code == 200: + response_200 = JobOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | JobOutput]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | JobOutput]: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | JobOutput] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | JobOutput | None: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | JobOutput + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | JobOutput]: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | JobOutput] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | JobOutput | None: + """Get Job + + Retrieve job status. + + Args: + concept_id (str): + job_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | JobOutput + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/get_job_file.py b/src/ansys/conceptev/core/generated/api/concept_v2/get_job_file.py new file mode 100644 index 00000000..4e54ad38 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/get_job_file.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + concept_id: str, + job_id: str, + file_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job/{job_id}/files/{file_id}".format( + concept_id=quote(str(concept_id), safe=""), + job_id=quote(str(job_id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 307: + response_307 = cast(Any, None) + return response_307 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 409: + response_409 = cast(Any, None) + return response_409 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + job_id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Get Job File + + Retrieve a job output file. + + For local backends the file bytes are streamed directly. For remote + backends (e.g. HPS/S3) a 307 redirect to a presigned download URL is + returned instead. + + Args: + concept_id (str): + job_id (str): + file_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + job_id=job_id, + file_id=file_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/list_jobs.py b/src/ansys/conceptev/core/generated/api/concept_v2/list_jobs.py new file mode 100644 index 00000000..743fb53e --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/list_jobs.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.job_output import JobOutput +from ...types import Response + + +def _get_kwargs( + concept_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v2/concept/{concept_id}/job".format( + concept_id=quote(str(concept_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | list[JobOutput] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = JobOutput.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | list[JobOutput]] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | list[JobOutput] | None: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | list[JobOutput] + """ + + return sync_detailed( + concept_id=concept_id, + client=client, + ).parsed + + +async def asyncio_detailed( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError | list[JobOutput]]: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | list[JobOutput]] + """ + + kwargs = _get_kwargs( + concept_id=concept_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + concept_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | list[JobOutput] | None: + """Get Jobs List + + Retrieve list of jobs. + + Args: + concept_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | list[JobOutput] + """ + + return ( + await asyncio_detailed( + concept_id=concept_id, + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/open_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/open_concept.py new file mode 100644 index 00000000..cd184903 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/open_concept.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response + + +def _get_kwargs( + *, + path_to_file: str, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["path_to_file"] = path_to_file + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept:open", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + path_to_file=path_to_file, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + client=client, + path_to_file=path_to_file, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + path_to_file=path_to_file, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + path_to_file: str, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Open Concept + + Open a .cev concept file and load it into the file-system database. + + Reads the concept ID from inside the file so the filename can be any + human-readable name rather than the UUID. Registers the path so all + subsequent operations resolve the correct location without requiring + another open call. Multiple files in different directories can be + registered independently. + + Note: This endpoint is only meaningful when the file-system backend is + active. It is registered unconditionally so the route exists regardless + of which backend was configured at import time (important for tests that + swap configs via fixtures). + + Args: + path_to_file (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + path_to_file=path_to_file, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/save_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/save_concept.py new file mode 100644 index 00000000..3df3421e --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/save_concept.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_output import ConceptOutput +from ...models.concept_save_request import ConceptSaveRequest +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: ConceptSaveRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v2/concept/{id}/save".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptSaveRequest, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Save Concept + + Save a concept to a specified file path (filesystem backend only). + + Copies the ``.cev`` archive to the given path, re-registers the concept + at that location, and sets ``save_state`` to ``SaveState.SAVED``. + + Args: + id (str): + body (ConceptSaveRequest): Request body for the save-concept endpoint. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/update_concept.py b/src/ansys/conceptev/core/generated/api/concept_v2/update_concept.py new file mode 100644 index 00000000..042d49db --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/update_concept.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.concept_input import ConceptInput +from ...models.concept_output import ConceptOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: ConceptInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}".format( + id=quote(str(id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ConceptOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ConceptOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ConceptOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Response[Any | ConceptOutput | HTTPValidationError]: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ConceptOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: ConceptInput, +) -> Any | ConceptOutput | HTTPValidationError | None: + """Update Concept + + Update an existing concept in the database. + + Args: + id (str): + body (ConceptInput): Concept input — uses input variants of each part group. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ConceptOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/update_concept_part.py b/src/ansys/conceptev/core/generated/api/concept_v2/update_concept_part.py new file mode 100644 index 00000000..17b89785 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/update_concept_part.py @@ -0,0 +1,553 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.aero_input import AeroInput +from ...models.aero_output import AeroOutput +from ...models.architecture_input import ArchitectureInput +from ...models.architecture_output import ArchitectureOutput +from ...models.battery_fixed_voltages_input import BatteryFixedVoltagesInput +from ...models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from ...models.battery_lookup_table_input import BatteryLookupTableInput +from ...models.battery_lookup_table_output import BatteryLookupTableOutput +from ...models.concept_job_record import ConceptJobRecord +from ...models.drive_cycle_input import DriveCycleInput +from ...models.drive_cycle_output import DriveCycleOutput +from ...models.drive_cycle_requirement_input import DriveCycleRequirementInput +from ...models.drive_cycle_requirement_output import DriveCycleRequirementOutput +from ...models.dynamic_requirement_input import DynamicRequirementInput +from ...models.dynamic_requirement_output import DynamicRequirementOutput +from ...models.mass_input import MassInput +from ...models.mass_output import MassOutput +from ...models.motor_lab_input import MotorLabInput +from ...models.motor_lab_output import MotorLabOutput +from ...models.part_type import PartType +from ...models.static_requirement_input import StaticRequirementInput +from ...models.static_requirement_output import StaticRequirementOutput +from ...models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from ...models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from ...models.wheel_input import WheelInput +from ...models.wheel_output import WheelOutput +from ...types import Response + + +def _get_kwargs( + id: str, + part_type: PartType, + part_id: str, + *, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}/{part_type}/{part_id}".format( + id=quote(str(id), safe=""), + part_type=quote(str(part_type), safe=""), + part_id=quote(str(part_id), safe=""), + ), + } + + if isinstance(body, MotorLabInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryFixedVoltagesInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, BatteryLookupTableInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, TransmissionLossCoefficientsInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, AeroInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, MassInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, WheelInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, ArchitectureInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DriveCycleRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, DynamicRequirementInput): + _kwargs["json"] = body.to_dict() + elif isinstance(body, StaticRequirementInput): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + if response.status_code == 200: + + def _parse_response_200( + data: object, + ) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_0 = MotorLabOutput.from_dict(data) + + return response_200_type_0_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return response_200_type_0_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_2 = BatteryLookupTableOutput.from_dict(data) + + return response_200_type_0_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return response_200_type_0_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_0 = AeroOutput.from_dict(data) + + return response_200_type_1_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_1 = MassOutput.from_dict(data) + + return response_200_type_1_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_1_type_2 = WheelOutput.from_dict(data) + + return response_200_type_1_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_2 = ArchitectureOutput.from_dict(data) + + return response_200_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return response_200_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_1 = DynamicRequirementOutput.from_dict(data) + + return response_200_type_3_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_3_type_2 = StaticRequirementOutput.from_dict(data) + + return response_200_type_3_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_4 = DriveCycleOutput.from_dict(data) + + return response_200_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_5 = ConceptJobRecord.from_dict(data) + + return response_200_type_5 + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = cast(Any, None) + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return sync_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> Response[ + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any +]: + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any] + """ + + kwargs = _get_kwargs( + id=id, + part_type=part_type, + part_id=part_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + part_type: PartType, + part_id: str, + *, + client: AuthenticatedClient | Client, + body: ( + AeroInput + | ArchitectureInput + | BatteryFixedVoltagesInput + | BatteryLookupTableInput + | DriveCycleInput + | DriveCycleRequirementInput + | DynamicRequirementInput + | MassInput + | MotorLabInput + | StaticRequirementInput + | TransmissionLossCoefficientsInput + | WheelInput + ), +) -> ( + AeroOutput + | ArchitectureOutput + | BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | ConceptJobRecord + | DriveCycleOutput + | DriveCycleRequirementOutput + | DynamicRequirementOutput + | MassOutput + | MotorLabOutput + | StaticRequirementOutput + | TransmissionLossCoefficientsOutput + | WheelOutput + | Any + | None +): + """Update Concept Part + + Update an existing part within a concept. + + Args: + id (str): + part_type (PartType): Part type enum. + part_id (str): + body (AeroInput | ArchitectureInput | BatteryFixedVoltagesInput | BatteryLookupTableInput + | DriveCycleInput | DriveCycleRequirementInput | DynamicRequirementInput | MassInput | + MotorLabInput | StaticRequirementInput | TransmissionLossCoefficientsInput | WheelInput): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AeroOutput | ArchitectureOutput | BatteryFixedVoltagesOutput | BatteryLookupTableOutput | ConceptJobRecord | DriveCycleOutput | DriveCycleRequirementOutput | DynamicRequirementOutput | MassOutput | MotorLabOutput | StaticRequirementOutput | TransmissionLossCoefficientsOutput | WheelOutput | Any + """ + + return ( + await asyncio_detailed( + id=id, + part_type=part_type, + part_id=part_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/concept_v2/update_file_item.py b/src/ansys/conceptev/core/generated/api/concept_v2/update_file_item.py new file mode 100644 index 00000000..2d8967fb --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/concept_v2/update_file_item.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_item_input import FileItemInput +from ...models.file_item_output import FileItemOutput +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + file_id: str, + *, + body: FileItemInput, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v2/concept/{id}/files/{file_id}".format( + id=quote(str(id), safe=""), + file_id=quote(str(file_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | FileItemOutput | HTTPValidationError | None: + if response.status_code == 200: + response_200 = FileItemOutput.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | FileItemOutput | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return sync_detailed( + id=id, + file_id=file_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Response[Any | FileItemOutput | HTTPValidationError]: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | FileItemOutput | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + file_id=file_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + file_id: str, + *, + client: AuthenticatedClient | Client, + body: FileItemInput, +) -> Any | FileItemOutput | HTTPValidationError | None: + """Update File + + Update an existing file for a concept. + + Args: + id (str): + file_id (str): + body (FileItemInput): File Item Input — metadata supplied when registering a stored file. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | FileItemOutput | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + file_id=file_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/__init__.py b/src/ansys/conceptev/core/generated/api/unit_choices/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/create_unit_choices_unit_choices_post.py b/src/ansys/conceptev/core/generated/api/unit_choices/create_unit_choices_unit_choices_post.py new file mode 100644 index 00000000..f6b02b61 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/create_unit_choices_unit_choices_post.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs( + *, + body: UnitChoices, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/unit_choices", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | UnitChoices | None: + if response.status_code == 201: + response_201 = UnitChoices.from_dict(response.json()) + + return response_201 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Create Unit Choices + + Create. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/delete_unit_choices_delete.py b/src/ansys/conceptev/core/generated/api/unit_choices/delete_unit_choices_delete.py new file mode 100644 index 00000000..7ab4449b --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/delete_unit_choices_delete.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/unit_choices", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | None: + if response.status_code == 200: + return None + + if response.status_code == 404: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete + + Delete by ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete + + Delete by ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/get_info_unit_choices_info_get.py b/src/ansys/conceptev/core/generated/api/unit_choices/get_info_unit_choices_info_get.py new file mode 100644 index 00000000..ddb5e5ac --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/get_info_unit_choices_info_get.py @@ -0,0 +1,144 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_info_unit_choices_info_get_response_get_info_unit_choices_info_get import ( + GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet, +) +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/unit_choices/info", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + if response.status_code == 200: + response_200 = GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet]: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet | None: + """Get Info + + Get table of units for frontend generation. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/read_unit_choices_get.py b/src/ansys/conceptev/core/generated/api/unit_choices/read_unit_choices_get.py new file mode 100644 index 00000000..4a020ec8 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/read_unit_choices_get.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/unit_choices", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | UnitChoices | None: + if response.status_code == 200: + response_200 = UnitChoices.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | UnitChoices]: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | UnitChoices] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> Any | UnitChoices | None: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | UnitChoices + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any | UnitChoices]: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | UnitChoices] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> Any | UnitChoices | None: + """Read + + Get from ID. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/api/unit_choices/update_unit_choices_put.py b/src/ansys/conceptev/core/generated/api/unit_choices/update_unit_choices_put.py new file mode 100644 index 00000000..b1cdf4d6 --- /dev/null +++ b/src/ansys/conceptev/core/generated/api/unit_choices/update_unit_choices_put.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.unit_choices import UnitChoices +from ...types import Response + + +def _get_kwargs( + *, + body: UnitChoices, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/unit_choices", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | UnitChoices | None: + if response.status_code == 200: + response_200 = UnitChoices.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError | UnitChoices]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Response[Any | HTTPValidationError | UnitChoices]: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError | UnitChoices] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UnitChoices, +) -> Any | HTTPValidationError | UnitChoices | None: + """Update + + Update with new parameters. + + Args: + body (UnitChoices): Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError | UnitChoices + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/ansys/conceptev/core/generated/client.py b/src/ansys/conceptev/core/generated/client.py new file mode 100644 index 00000000..802f9a58 --- /dev/null +++ b/src/ansys/conceptev/core/generated/client.py @@ -0,0 +1,264 @@ +import ssl +from typing import Any + +from attrs import define, evolve, field +import httpx + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + """The token to use for authentication""" + prefix: str = "Bearer" + """The prefix to use for the Authorization header""" + auth_header_name: str = "Authorization" + """The name of the Authorization header""" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/ansys/conceptev/core/generated/errors.py b/src/ansys/conceptev/core/generated/errors.py new file mode 100644 index 00000000..5f92e76a --- /dev/null +++ b/src/ansys/conceptev/core/generated/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/src/ansys/conceptev/core/generated/models/__init__.py b/src/ansys/conceptev/core/generated/models/__init__.py new file mode 100644 index 00000000..81d0a41b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/__init__.py @@ -0,0 +1,223 @@ +"""Contains all the data models used in inputs/outputs""" + +from .acceleration_unit import AccelerationUnit +from .aero import Aero +from .aero_input import AeroInput +from .aero_output import AeroOutput +from .angle_unit import AngleUnit +from .angular_acceleration_unit import AngularAccelerationUnit +from .angular_speed_unit import AngularSpeedUnit +from .architecture_input import ArchitectureInput +from .architecture_output import ArchitectureOutput +from .area_unit import AreaUnit +from .battery_configuration import BatteryConfiguration +from .battery_fixed_voltages_input import BatteryFixedVoltagesInput +from .battery_fixed_voltages_output import BatteryFixedVoltagesOutput +from .battery_lookup_table_data import BatteryLookupTableData +from .battery_lookup_table_input import BatteryLookupTableInput +from .battery_lookup_table_output import BatteryLookupTableOutput +from .battery_state import BatteryState +from .body_create_file_item import BodyCreateFileItem +from .check_job_backend_availability_response_check_job_backend_availability import ( + CheckJobBackendAvailabilityResponseCheckJobBackendAvailability, +) +from .component_axle import ComponentAxle +from .component_configuration_set import ComponentConfigurationSet +from .component_file_type import ComponentFileType +from .component_loss_map_args import ComponentLossMapArgs +from .concept_input import ConceptInput +from .concept_job_record import ConceptJobRecord +from .concept_output import ConceptOutput +from .concept_save_request import ConceptSaveRequest +from .current_unit import CurrentUnit +from .density_unit import DensityUnit +from .drive_cycle_input import DriveCycleInput +from .drive_cycle_output import DriveCycleOutput +from .drive_cycle_requirement_input import DriveCycleRequirementInput +from .drive_cycle_requirement_output import DriveCycleRequirementOutput +from .dynamic_requirement_input import DynamicRequirementInput +from .dynamic_requirement_output import DynamicRequirementOutput +from .edge import Edge +from .electric_charge_unit import ElectricChargeUnit +from .electrical_energy_unit import ElectricalEnergyUnit +from .electrical_power_unit import ElectricalPowerUnit +from .energy_unit import EnergyUnit +from .file_info import FileInfo +from .file_item_create_response import FileItemCreateResponse +from .file_item_create_response_calculated_values import FileItemCreateResponseCalculatedValues +from .file_item_input import FileItemInput +from .file_item_output import FileItemOutput +from .force_unit import ForceUnit +from .frequency_unit import FrequencyUnit +from .get_info_unit_choices_info_get_response_get_info_unit_choices_info_get import ( + GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet, +) +from .http_validation_error import HTTPValidationError +from .inertia_unit import InertiaUnit +from .job_output import JobOutput +from .job_request import JobRequest +from .length_unit import LengthUnit +from .loss_map_grid_lab import LossMapGridLab +from .loss_map_grid_power import LossMapGridPower +from .loss_map_grid_power_meta_data import LossMapGridPowerMetaData +from .mass import Mass +from .mass_input import MassInput +from .mass_output import MassOutput +from .mass_unit import MassUnit +from .motor_configuration import MotorConfiguration +from .motor_lab_data import MotorLabData +from .motor_lab_data_lab_file_dict import MotorLabDataLabFileDict +from .motor_lab_input import MotorLabInput +from .motor_lab_output import MotorLabOutput +from .motor_state import MotorState +from .motor_thermal_limits import MotorThermalLimits +from .node import Node +from .part_type import PartType +from .power_unit import PowerUnit +from .pressure_unit import PressureUnit +from .ratio_unit import RatioUnit +from .resistance_unit import ResistanceUnit +from .road_efficiency_unit import RoadEfficiencyUnit +from .save_state import SaveState +from .speed_unit import SpeedUnit +from .static_requirement_input import StaticRequirementInput +from .static_requirement_output import StaticRequirementOutput +from .surface_condition_traction_configs import SurfaceConditionTractionConfigs +from .temperature_unit import TemperatureUnit +from .thermal_model import ThermalModel +from .thermal_model_loss_map import ThermalModelLossMap +from .thermal_model_loss_map_additional_property import ThermalModelLossMapAdditionalProperty +from .thermal_model_temperature_map import ThermalModelTemperatureMap +from .thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, +) +from .thermal_network import ThermalNetwork +from .thermal_network_edges import ThermalNetworkEdges +from .thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict +from .thermal_network_nodes import ThermalNetworkNodes +from .thermal_network_speed_dict import ThermalNetworkSpeedDict +from .time_unit import TimeUnit +from .torque_unit import TorqueUnit +from .total_tractive_torque_graph_input import TotalTractiveTorqueGraphInput +from .total_tractive_torque_graph_output import TotalTractiveTorqueGraphOutput +from .transmission_loss_coefficients_input import TransmissionLossCoefficientsInput +from .transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput +from .unit_choices import UnitChoices +from .unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap +from .validation_error import ValidationError +from .validation_error_context import ValidationErrorContext +from .voltage_unit import VoltageUnit +from .volume_unit import VolumeUnit +from .volumetric_flow_rate_unit import VolumetricFlowRateUnit +from .wheel_input import WheelInput +from .wheel_output import WheelOutput +from .wheel_rolling_resistance_configs import WheelRollingResistanceConfigs + +__all__ = ( + "AccelerationUnit", + "Aero", + "AeroInput", + "AeroOutput", + "AngleUnit", + "AngularAccelerationUnit", + "AngularSpeedUnit", + "ArchitectureInput", + "ArchitectureOutput", + "AreaUnit", + "BatteryConfiguration", + "BatteryFixedVoltagesInput", + "BatteryFixedVoltagesOutput", + "BatteryLookupTableData", + "BatteryLookupTableInput", + "BatteryLookupTableOutput", + "BatteryState", + "BodyCreateFileItem", + "CheckJobBackendAvailabilityResponseCheckJobBackendAvailability", + "ComponentAxle", + "ComponentConfigurationSet", + "ComponentFileType", + "ComponentLossMapArgs", + "ConceptInput", + "ConceptJobRecord", + "ConceptOutput", + "ConceptSaveRequest", + "CurrentUnit", + "DensityUnit", + "DriveCycleInput", + "DriveCycleOutput", + "DriveCycleRequirementInput", + "DriveCycleRequirementOutput", + "DynamicRequirementInput", + "DynamicRequirementOutput", + "Edge", + "ElectricalEnergyUnit", + "ElectricalPowerUnit", + "ElectricChargeUnit", + "EnergyUnit", + "FileInfo", + "FileItemCreateResponse", + "FileItemCreateResponseCalculatedValues", + "FileItemInput", + "FileItemOutput", + "ForceUnit", + "FrequencyUnit", + "GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet", + "HTTPValidationError", + "InertiaUnit", + "JobOutput", + "JobRequest", + "LengthUnit", + "LossMapGridLab", + "LossMapGridPower", + "LossMapGridPowerMetaData", + "Mass", + "MassInput", + "MassOutput", + "MassUnit", + "MotorConfiguration", + "MotorLabData", + "MotorLabDataLabFileDict", + "MotorLabInput", + "MotorLabOutput", + "MotorState", + "MotorThermalLimits", + "Node", + "PartType", + "PowerUnit", + "PressureUnit", + "RatioUnit", + "ResistanceUnit", + "RoadEfficiencyUnit", + "SaveState", + "SpeedUnit", + "StaticRequirementInput", + "StaticRequirementOutput", + "SurfaceConditionTractionConfigs", + "TemperatureUnit", + "ThermalModel", + "ThermalModelLossMap", + "ThermalModelLossMapAdditionalProperty", + "ThermalModelTemperatureMap", + "ThermalModelTemperatureMapAdditionalProperty", + "ThermalNetwork", + "ThermalNetworkEdges", + "ThermalNetworkFlowRateDict", + "ThermalNetworkNodes", + "ThermalNetworkSpeedDict", + "TimeUnit", + "TorqueUnit", + "TotalTractiveTorqueGraphInput", + "TotalTractiveTorqueGraphOutput", + "TransmissionLossCoefficientsInput", + "TransmissionLossCoefficientsOutput", + "UnitChoices", + "UnitChoicesUnitTypeToUnitMap", + "ValidationError", + "ValidationErrorContext", + "VoltageUnit", + "VolumetricFlowRateUnit", + "VolumeUnit", + "WheelInput", + "WheelOutput", + "WheelRollingResistanceConfigs", +) diff --git a/src/ansys/conceptev/core/generated/models/acceleration_unit.py b/src/ansys/conceptev/core/generated/models/acceleration_unit.py new file mode 100644 index 00000000..18eea3de --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/acceleration_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +AccelerationUnit = Literal["km/hr/s", "m/s²", "mph/s"] + +ACCELERATION_UNIT_VALUES: set[AccelerationUnit] = { + "km/hr/s", + "m/s²", + "mph/s", +} + + +def check_acceleration_unit(value: str) -> AccelerationUnit: + if value in ACCELERATION_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ACCELERATION_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/aero.py b/src/ansys/conceptev/core/generated/models/aero.py new file mode 100644 index 00000000..b6a92629 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/aero.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Aero") + + +@_attrs_define +class Aero: + """Aero Configuration.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + aero = cls( + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + ) + + aero.additional_properties = d + return aero + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/aero_input.py b/src/ansys/conceptev/core/generated/models/aero_input.py new file mode 100644 index 00000000..a8a2428a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/aero_input.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AeroInput") + + +@_attrs_define +class AeroInput: + """Aero Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + aero_input = cls( + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + part_type=part_type, + ) + + aero_input.additional_properties = d + return aero_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/aero_output.py b/src/ansys/conceptev/core/generated/models/aero_output.py new file mode 100644 index 00000000..92219408 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/aero_output.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AeroOutput") + + +@_attrs_define +class AeroOutput: + """Aero Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Aero Config" + drag_coefficient: float | Unset = 0.4 + drag_coefficient_rear: float | None | Unset = UNSET + cross_sectional_area: float | Unset = 2.0 + config_type: Literal["aero"] | Unset = "aero" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + drag_coefficient = self.drag_coefficient + + drag_coefficient_rear: float | None | Unset + if isinstance(self.drag_coefficient_rear, Unset): + drag_coefficient_rear = UNSET + else: + drag_coefficient_rear = self.drag_coefficient_rear + + cross_sectional_area = self.cross_sectional_area + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if drag_coefficient is not UNSET: + field_dict["drag_coefficient"] = drag_coefficient + if drag_coefficient_rear is not UNSET: + field_dict["drag_coefficient_rear"] = drag_coefficient_rear + if cross_sectional_area is not UNSET: + field_dict["cross_sectional_area"] = cross_sectional_area + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + drag_coefficient = d.pop("drag_coefficient", UNSET) + + def _parse_drag_coefficient_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + drag_coefficient_rear = _parse_drag_coefficient_rear(d.pop("drag_coefficient_rear", UNSET)) + + cross_sectional_area = d.pop("cross_sectional_area", UNSET) + + config_type = cast(Literal["aero"] | Unset, d.pop("config_type", UNSET)) + if config_type != "aero" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'aero', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + aero_output = cls( + id=id, + item_type=item_type, + name=name, + drag_coefficient=drag_coefficient, + drag_coefficient_rear=drag_coefficient_rear, + cross_sectional_area=cross_sectional_area, + config_type=config_type, + part_type=part_type, + ) + + aero_output.additional_properties = d + return aero_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/angle_unit.py b/src/ansys/conceptev/core/generated/models/angle_unit.py new file mode 100644 index 00000000..7a0eab57 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/angle_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +AngleUnit = Literal["%", "deg", "rad"] + +ANGLE_UNIT_VALUES: set[AngleUnit] = { + "%", + "deg", + "rad", +} + + +def check_angle_unit(value: str) -> AngleUnit: + if value in ANGLE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ANGLE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/angular_acceleration_unit.py b/src/ansys/conceptev/core/generated/models/angular_acceleration_unit.py new file mode 100644 index 00000000..08332033 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/angular_acceleration_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +AngularAccelerationUnit = Literal["deg/s²", "rad/s²", "rpm/s", "rps/s"] + +ANGULAR_ACCELERATION_UNIT_VALUES: set[AngularAccelerationUnit] = { + "deg/s²", + "rad/s²", + "rpm/s", + "rps/s", +} + + +def check_angular_acceleration_unit(value: str) -> AngularAccelerationUnit: + if value in ANGULAR_ACCELERATION_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ANGULAR_ACCELERATION_UNIT_VALUES!r}" + ) diff --git a/src/ansys/conceptev/core/generated/models/angular_speed_unit.py b/src/ansys/conceptev/core/generated/models/angular_speed_unit.py new file mode 100644 index 00000000..cbd1197a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/angular_speed_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +AngularSpeedUnit = Literal["deg/s", "rad/s", "rpm", "rps"] + +ANGULAR_SPEED_UNIT_VALUES: set[AngularSpeedUnit] = { + "deg/s", + "rad/s", + "rpm", + "rps", +} + + +def check_angular_speed_unit(value: str) -> AngularSpeedUnit: + if value in ANGULAR_SPEED_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ANGULAR_SPEED_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/architecture_input.py b/src/ansys/conceptev/core/generated/models/architecture_input.py new file mode 100644 index 00000000..999a6450 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/architecture_input.py @@ -0,0 +1,345 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ArchitectureInput") + + +@_attrs_define +class ArchitectureInput: + """Architecture Input.""" + + battery_id: str + wheelbase: float | None | Unset = UNSET + number_of_front_motors: int | Unset = 0 + number_of_front_wheels: int | Unset = 2 + number_of_rear_motors: int | Unset = 0 + number_of_rear_wheels: int | Unset = 2 + battery: None | Unset = UNSET + front_transmission: None | Unset = UNSET + front_motor: None | Unset = UNSET + front_inverter: None | Unset = UNSET + front_clutch: None | Unset = UNSET + rear_transmission: None | Unset = UNSET + rear_motor: None | Unset = UNSET + rear_inverter: None | Unset = UNSET + rear_clutch: None | Unset = UNSET + front_transmission_id: None | str | Unset = UNSET + front_motor_id: None | str | Unset = UNSET + front_inverter_id: None | str | Unset = UNSET + front_clutch_id: None | str | Unset = UNSET + rear_transmission_id: None | str | Unset = UNSET + rear_motor_id: None | str | Unset = UNSET + rear_inverter_id: None | str | Unset = UNSET + rear_clutch_id: None | str | Unset = UNSET + part_type: Literal["architecture"] | Unset = "architecture" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + battery_id = self.battery_id + + wheelbase: float | None | Unset + if isinstance(self.wheelbase, Unset): + wheelbase = UNSET + else: + wheelbase = self.wheelbase + + number_of_front_motors = self.number_of_front_motors + + number_of_front_wheels = self.number_of_front_wheels + + number_of_rear_motors = self.number_of_rear_motors + + number_of_rear_wheels = self.number_of_rear_wheels + + battery = self.battery + + front_transmission = self.front_transmission + + front_motor = self.front_motor + + front_inverter = self.front_inverter + + front_clutch = self.front_clutch + + rear_transmission = self.rear_transmission + + rear_motor = self.rear_motor + + rear_inverter = self.rear_inverter + + rear_clutch = self.rear_clutch + + front_transmission_id: None | str | Unset + if isinstance(self.front_transmission_id, Unset): + front_transmission_id = UNSET + else: + front_transmission_id = self.front_transmission_id + + front_motor_id: None | str | Unset + if isinstance(self.front_motor_id, Unset): + front_motor_id = UNSET + else: + front_motor_id = self.front_motor_id + + front_inverter_id: None | str | Unset + if isinstance(self.front_inverter_id, Unset): + front_inverter_id = UNSET + else: + front_inverter_id = self.front_inverter_id + + front_clutch_id: None | str | Unset + if isinstance(self.front_clutch_id, Unset): + front_clutch_id = UNSET + else: + front_clutch_id = self.front_clutch_id + + rear_transmission_id: None | str | Unset + if isinstance(self.rear_transmission_id, Unset): + rear_transmission_id = UNSET + else: + rear_transmission_id = self.rear_transmission_id + + rear_motor_id: None | str | Unset + if isinstance(self.rear_motor_id, Unset): + rear_motor_id = UNSET + else: + rear_motor_id = self.rear_motor_id + + rear_inverter_id: None | str | Unset + if isinstance(self.rear_inverter_id, Unset): + rear_inverter_id = UNSET + else: + rear_inverter_id = self.rear_inverter_id + + rear_clutch_id: None | str | Unset + if isinstance(self.rear_clutch_id, Unset): + rear_clutch_id = UNSET + else: + rear_clutch_id = self.rear_clutch_id + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "battery_id": battery_id, + } + ) + if wheelbase is not UNSET: + field_dict["wheelbase"] = wheelbase + if number_of_front_motors is not UNSET: + field_dict["number_of_front_motors"] = number_of_front_motors + if number_of_front_wheels is not UNSET: + field_dict["number_of_front_wheels"] = number_of_front_wheels + if number_of_rear_motors is not UNSET: + field_dict["number_of_rear_motors"] = number_of_rear_motors + if number_of_rear_wheels is not UNSET: + field_dict["number_of_rear_wheels"] = number_of_rear_wheels + if battery is not UNSET: + field_dict["battery"] = battery + if front_transmission is not UNSET: + field_dict["front_transmission"] = front_transmission + if front_motor is not UNSET: + field_dict["front_motor"] = front_motor + if front_inverter is not UNSET: + field_dict["front_inverter"] = front_inverter + if front_clutch is not UNSET: + field_dict["front_clutch"] = front_clutch + if rear_transmission is not UNSET: + field_dict["rear_transmission"] = rear_transmission + if rear_motor is not UNSET: + field_dict["rear_motor"] = rear_motor + if rear_inverter is not UNSET: + field_dict["rear_inverter"] = rear_inverter + if rear_clutch is not UNSET: + field_dict["rear_clutch"] = rear_clutch + if front_transmission_id is not UNSET: + field_dict["front_transmission_id"] = front_transmission_id + if front_motor_id is not UNSET: + field_dict["front_motor_id"] = front_motor_id + if front_inverter_id is not UNSET: + field_dict["front_inverter_id"] = front_inverter_id + if front_clutch_id is not UNSET: + field_dict["front_clutch_id"] = front_clutch_id + if rear_transmission_id is not UNSET: + field_dict["rear_transmission_id"] = rear_transmission_id + if rear_motor_id is not UNSET: + field_dict["rear_motor_id"] = rear_motor_id + if rear_inverter_id is not UNSET: + field_dict["rear_inverter_id"] = rear_inverter_id + if rear_clutch_id is not UNSET: + field_dict["rear_clutch_id"] = rear_clutch_id + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + battery_id = d.pop("battery_id") + + def _parse_wheelbase(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + wheelbase = _parse_wheelbase(d.pop("wheelbase", UNSET)) + + number_of_front_motors = d.pop("number_of_front_motors", UNSET) + + number_of_front_wheels = d.pop("number_of_front_wheels", UNSET) + + number_of_rear_motors = d.pop("number_of_rear_motors", UNSET) + + number_of_rear_wheels = d.pop("number_of_rear_wheels", UNSET) + + battery = d.pop("battery", UNSET) + + front_transmission = d.pop("front_transmission", UNSET) + + front_motor = d.pop("front_motor", UNSET) + + front_inverter = d.pop("front_inverter", UNSET) + + front_clutch = d.pop("front_clutch", UNSET) + + rear_transmission = d.pop("rear_transmission", UNSET) + + rear_motor = d.pop("rear_motor", UNSET) + + rear_inverter = d.pop("rear_inverter", UNSET) + + rear_clutch = d.pop("rear_clutch", UNSET) + + def _parse_front_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_transmission_id = _parse_front_transmission_id(d.pop("front_transmission_id", UNSET)) + + def _parse_front_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_motor_id = _parse_front_motor_id(d.pop("front_motor_id", UNSET)) + + def _parse_front_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_inverter_id = _parse_front_inverter_id(d.pop("front_inverter_id", UNSET)) + + def _parse_front_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_clutch_id = _parse_front_clutch_id(d.pop("front_clutch_id", UNSET)) + + def _parse_rear_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_transmission_id = _parse_rear_transmission_id(d.pop("rear_transmission_id", UNSET)) + + def _parse_rear_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_motor_id = _parse_rear_motor_id(d.pop("rear_motor_id", UNSET)) + + def _parse_rear_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_inverter_id = _parse_rear_inverter_id(d.pop("rear_inverter_id", UNSET)) + + def _parse_rear_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_clutch_id = _parse_rear_clutch_id(d.pop("rear_clutch_id", UNSET)) + + part_type = cast(Literal["architecture"] | Unset, d.pop("part_type", UNSET)) + if part_type != "architecture" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'architecture', got '{part_type}'") + + architecture_input = cls( + battery_id=battery_id, + wheelbase=wheelbase, + number_of_front_motors=number_of_front_motors, + number_of_front_wheels=number_of_front_wheels, + number_of_rear_motors=number_of_rear_motors, + number_of_rear_wheels=number_of_rear_wheels, + battery=battery, + front_transmission=front_transmission, + front_motor=front_motor, + front_inverter=front_inverter, + front_clutch=front_clutch, + rear_transmission=rear_transmission, + rear_motor=rear_motor, + rear_inverter=rear_inverter, + rear_clutch=rear_clutch, + front_transmission_id=front_transmission_id, + front_motor_id=front_motor_id, + front_inverter_id=front_inverter_id, + front_clutch_id=front_clutch_id, + rear_transmission_id=rear_transmission_id, + rear_motor_id=rear_motor_id, + rear_inverter_id=rear_inverter_id, + rear_clutch_id=rear_clutch_id, + part_type=part_type, + ) + + architecture_input.additional_properties = d + return architecture_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/architecture_output.py b/src/ansys/conceptev/core/generated/models/architecture_output.py new file mode 100644 index 00000000..37ca1897 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/architecture_output.py @@ -0,0 +1,376 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ArchitectureOutput") + + +@_attrs_define +class ArchitectureOutput: + """Architecture Output.""" + + id: str + battery_id: str + wheelbase: float | None | Unset = UNSET + number_of_front_motors: int | Unset = 0 + number_of_front_wheels: int | Unset = 2 + number_of_rear_motors: int | Unset = 0 + number_of_rear_wheels: int | Unset = 2 + battery: None | Unset = UNSET + front_transmission: None | Unset = UNSET + front_motor: None | Unset = UNSET + front_inverter: None | Unset = UNSET + front_clutch: None | Unset = UNSET + rear_transmission: None | Unset = UNSET + rear_motor: None | Unset = UNSET + rear_inverter: None | Unset = UNSET + rear_clutch: None | Unset = UNSET + front_transmission_id: None | str | Unset = UNSET + front_motor_id: None | str | Unset = UNSET + front_inverter_id: None | str | Unset = UNSET + front_clutch_id: None | str | Unset = UNSET + rear_transmission_id: None | str | Unset = UNSET + rear_motor_id: None | str | Unset = UNSET + rear_inverter_id: None | str | Unset = UNSET + rear_clutch_id: None | str | Unset = UNSET + part_type: Literal["architecture"] | Unset = "architecture" + components_cost: float | Unset = 0.0 + components_mass: float | Unset = 0.0 + max_wheel_speed: float | Unset = 0.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + battery_id = self.battery_id + + wheelbase: float | None | Unset + if isinstance(self.wheelbase, Unset): + wheelbase = UNSET + else: + wheelbase = self.wheelbase + + number_of_front_motors = self.number_of_front_motors + + number_of_front_wheels = self.number_of_front_wheels + + number_of_rear_motors = self.number_of_rear_motors + + number_of_rear_wheels = self.number_of_rear_wheels + + battery = self.battery + + front_transmission = self.front_transmission + + front_motor = self.front_motor + + front_inverter = self.front_inverter + + front_clutch = self.front_clutch + + rear_transmission = self.rear_transmission + + rear_motor = self.rear_motor + + rear_inverter = self.rear_inverter + + rear_clutch = self.rear_clutch + + front_transmission_id: None | str | Unset + if isinstance(self.front_transmission_id, Unset): + front_transmission_id = UNSET + else: + front_transmission_id = self.front_transmission_id + + front_motor_id: None | str | Unset + if isinstance(self.front_motor_id, Unset): + front_motor_id = UNSET + else: + front_motor_id = self.front_motor_id + + front_inverter_id: None | str | Unset + if isinstance(self.front_inverter_id, Unset): + front_inverter_id = UNSET + else: + front_inverter_id = self.front_inverter_id + + front_clutch_id: None | str | Unset + if isinstance(self.front_clutch_id, Unset): + front_clutch_id = UNSET + else: + front_clutch_id = self.front_clutch_id + + rear_transmission_id: None | str | Unset + if isinstance(self.rear_transmission_id, Unset): + rear_transmission_id = UNSET + else: + rear_transmission_id = self.rear_transmission_id + + rear_motor_id: None | str | Unset + if isinstance(self.rear_motor_id, Unset): + rear_motor_id = UNSET + else: + rear_motor_id = self.rear_motor_id + + rear_inverter_id: None | str | Unset + if isinstance(self.rear_inverter_id, Unset): + rear_inverter_id = UNSET + else: + rear_inverter_id = self.rear_inverter_id + + rear_clutch_id: None | str | Unset + if isinstance(self.rear_clutch_id, Unset): + rear_clutch_id = UNSET + else: + rear_clutch_id = self.rear_clutch_id + + part_type = self.part_type + + components_cost = self.components_cost + + components_mass = self.components_mass + + max_wheel_speed = self.max_wheel_speed + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "battery_id": battery_id, + } + ) + if wheelbase is not UNSET: + field_dict["wheelbase"] = wheelbase + if number_of_front_motors is not UNSET: + field_dict["number_of_front_motors"] = number_of_front_motors + if number_of_front_wheels is not UNSET: + field_dict["number_of_front_wheels"] = number_of_front_wheels + if number_of_rear_motors is not UNSET: + field_dict["number_of_rear_motors"] = number_of_rear_motors + if number_of_rear_wheels is not UNSET: + field_dict["number_of_rear_wheels"] = number_of_rear_wheels + if battery is not UNSET: + field_dict["battery"] = battery + if front_transmission is not UNSET: + field_dict["front_transmission"] = front_transmission + if front_motor is not UNSET: + field_dict["front_motor"] = front_motor + if front_inverter is not UNSET: + field_dict["front_inverter"] = front_inverter + if front_clutch is not UNSET: + field_dict["front_clutch"] = front_clutch + if rear_transmission is not UNSET: + field_dict["rear_transmission"] = rear_transmission + if rear_motor is not UNSET: + field_dict["rear_motor"] = rear_motor + if rear_inverter is not UNSET: + field_dict["rear_inverter"] = rear_inverter + if rear_clutch is not UNSET: + field_dict["rear_clutch"] = rear_clutch + if front_transmission_id is not UNSET: + field_dict["front_transmission_id"] = front_transmission_id + if front_motor_id is not UNSET: + field_dict["front_motor_id"] = front_motor_id + if front_inverter_id is not UNSET: + field_dict["front_inverter_id"] = front_inverter_id + if front_clutch_id is not UNSET: + field_dict["front_clutch_id"] = front_clutch_id + if rear_transmission_id is not UNSET: + field_dict["rear_transmission_id"] = rear_transmission_id + if rear_motor_id is not UNSET: + field_dict["rear_motor_id"] = rear_motor_id + if rear_inverter_id is not UNSET: + field_dict["rear_inverter_id"] = rear_inverter_id + if rear_clutch_id is not UNSET: + field_dict["rear_clutch_id"] = rear_clutch_id + if part_type is not UNSET: + field_dict["part_type"] = part_type + if components_cost is not UNSET: + field_dict["components_cost"] = components_cost + if components_mass is not UNSET: + field_dict["components_mass"] = components_mass + if max_wheel_speed is not UNSET: + field_dict["max_wheel_speed"] = max_wheel_speed + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + battery_id = d.pop("battery_id") + + def _parse_wheelbase(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + wheelbase = _parse_wheelbase(d.pop("wheelbase", UNSET)) + + number_of_front_motors = d.pop("number_of_front_motors", UNSET) + + number_of_front_wheels = d.pop("number_of_front_wheels", UNSET) + + number_of_rear_motors = d.pop("number_of_rear_motors", UNSET) + + number_of_rear_wheels = d.pop("number_of_rear_wheels", UNSET) + + battery = d.pop("battery", UNSET) + + front_transmission = d.pop("front_transmission", UNSET) + + front_motor = d.pop("front_motor", UNSET) + + front_inverter = d.pop("front_inverter", UNSET) + + front_clutch = d.pop("front_clutch", UNSET) + + rear_transmission = d.pop("rear_transmission", UNSET) + + rear_motor = d.pop("rear_motor", UNSET) + + rear_inverter = d.pop("rear_inverter", UNSET) + + rear_clutch = d.pop("rear_clutch", UNSET) + + def _parse_front_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_transmission_id = _parse_front_transmission_id(d.pop("front_transmission_id", UNSET)) + + def _parse_front_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_motor_id = _parse_front_motor_id(d.pop("front_motor_id", UNSET)) + + def _parse_front_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_inverter_id = _parse_front_inverter_id(d.pop("front_inverter_id", UNSET)) + + def _parse_front_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + front_clutch_id = _parse_front_clutch_id(d.pop("front_clutch_id", UNSET)) + + def _parse_rear_transmission_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_transmission_id = _parse_rear_transmission_id(d.pop("rear_transmission_id", UNSET)) + + def _parse_rear_motor_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_motor_id = _parse_rear_motor_id(d.pop("rear_motor_id", UNSET)) + + def _parse_rear_inverter_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_inverter_id = _parse_rear_inverter_id(d.pop("rear_inverter_id", UNSET)) + + def _parse_rear_clutch_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rear_clutch_id = _parse_rear_clutch_id(d.pop("rear_clutch_id", UNSET)) + + part_type = cast(Literal["architecture"] | Unset, d.pop("part_type", UNSET)) + if part_type != "architecture" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'architecture', got '{part_type}'") + + components_cost = d.pop("components_cost", UNSET) + + components_mass = d.pop("components_mass", UNSET) + + max_wheel_speed = d.pop("max_wheel_speed", UNSET) + + architecture_output = cls( + id=id, + battery_id=battery_id, + wheelbase=wheelbase, + number_of_front_motors=number_of_front_motors, + number_of_front_wheels=number_of_front_wheels, + number_of_rear_motors=number_of_rear_motors, + number_of_rear_wheels=number_of_rear_wheels, + battery=battery, + front_transmission=front_transmission, + front_motor=front_motor, + front_inverter=front_inverter, + front_clutch=front_clutch, + rear_transmission=rear_transmission, + rear_motor=rear_motor, + rear_inverter=rear_inverter, + rear_clutch=rear_clutch, + front_transmission_id=front_transmission_id, + front_motor_id=front_motor_id, + front_inverter_id=front_inverter_id, + front_clutch_id=front_clutch_id, + rear_transmission_id=rear_transmission_id, + rear_motor_id=rear_motor_id, + rear_inverter_id=rear_inverter_id, + rear_clutch_id=rear_clutch_id, + part_type=part_type, + components_cost=components_cost, + components_mass=components_mass, + max_wheel_speed=max_wheel_speed, + ) + + architecture_output.additional_properties = d + return architecture_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/area_unit.py b/src/ansys/conceptev/core/generated/models/area_unit.py new file mode 100644 index 00000000..b326170e --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/area_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +AreaUnit = Literal["cm²", "ft²", "in²", "mm²", "m²", "yd²"] + +AREA_UNIT_VALUES: set[AreaUnit] = { + "cm²", + "ft²", + "in²", + "mm²", + "m²", + "yd²", +} + + +def check_area_unit(value: str) -> AreaUnit: + if value in AREA_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AREA_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/battery_configuration.py b/src/ansys/conceptev/core/generated/models/battery_configuration.py new file mode 100644 index 00000000..ee94f869 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_configuration.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryConfiguration") + + +@_attrs_define +class BatteryConfiguration: + """Configuration that can change characteristics of the battery.""" + + component_config_type: Literal["battery"] | Unset = "battery" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_config_type = self.component_config_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if component_config_type is not UNSET: + field_dict["component_config_type"] = component_config_type + if state is not UNSET: + field_dict["state"] = state + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + component_config_type = cast( + Literal["battery"] | Unset, d.pop("component_config_type", UNSET) + ) + if component_config_type != "battery" and not isinstance(component_config_type, Unset): + raise ValueError( + f"component_config_type must match const 'battery', got '{component_config_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + battery_configuration = cls( + component_config_type=component_config_type, + state=state, + ) + + battery_configuration.additional_properties = d + return battery_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_input.py b/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_input.py new file mode 100644 index 00000000..65f5f964 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_input.py @@ -0,0 +1,240 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryFixedVoltagesInput") + + +@_attrs_define +class BatteryFixedVoltagesInput: + """Battery Fixed Voltages Input.""" + + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Fixed Voltages Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryFixedVoltages"] | Unset = "BatteryFixedVoltages" + voltage_max: float | Unset = 400.0 + voltage_min: float | None | Unset = UNSET + charge_acceptance_limit: float | None | Unset = UNSET + charge_release_limit: float | None | Unset = UNSET + capacity: float | None | Unset = UNSET + internal_resistance_charge: float | Unset = 0.0 + internal_resistance_discharge: float | Unset = 0.0 + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + voltage_max = self.voltage_max + + voltage_min: float | None | Unset + if isinstance(self.voltage_min, Unset): + voltage_min = UNSET + else: + voltage_min = self.voltage_min + + charge_acceptance_limit: float | None | Unset + if isinstance(self.charge_acceptance_limit, Unset): + charge_acceptance_limit = UNSET + else: + charge_acceptance_limit = self.charge_acceptance_limit + + charge_release_limit: float | None | Unset + if isinstance(self.charge_release_limit, Unset): + charge_release_limit = UNSET + else: + charge_release_limit = self.charge_release_limit + + capacity: float | None | Unset + if isinstance(self.capacity, Unset): + capacity = UNSET + else: + capacity = self.capacity + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if voltage_max is not UNSET: + field_dict["voltage_max"] = voltage_max + if voltage_min is not UNSET: + field_dict["voltage_min"] = voltage_min + if charge_acceptance_limit is not UNSET: + field_dict["charge_acceptance_limit"] = charge_acceptance_limit + if charge_release_limit is not UNSET: + field_dict["charge_release_limit"] = charge_release_limit + if capacity is not UNSET: + field_dict["capacity"] = capacity + if internal_resistance_charge is not UNSET: + field_dict["internal_resistance_charge"] = internal_resistance_charge + if internal_resistance_discharge is not UNSET: + field_dict["internal_resistance_discharge"] = internal_resistance_discharge + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["BatteryFixedVoltages"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "BatteryFixedVoltages" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryFixedVoltages', got '{component_type}'" + ) + + voltage_max = d.pop("voltage_max", UNSET) + + def _parse_voltage_min(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage_min = _parse_voltage_min(d.pop("voltage_min", UNSET)) + + def _parse_charge_acceptance_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_acceptance_limit = _parse_charge_acceptance_limit( + d.pop("charge_acceptance_limit", UNSET) + ) + + def _parse_charge_release_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_release_limit = _parse_charge_release_limit(d.pop("charge_release_limit", UNSET)) + + def _parse_capacity(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + capacity = _parse_capacity(d.pop("capacity", UNSET)) + + internal_resistance_charge = d.pop("internal_resistance_charge", UNSET) + + internal_resistance_discharge = d.pop("internal_resistance_discharge", UNSET) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_fixed_voltages_input = cls( + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + voltage_max=voltage_max, + voltage_min=voltage_min, + charge_acceptance_limit=charge_acceptance_limit, + charge_release_limit=charge_release_limit, + capacity=capacity, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + state=state, + part_type=part_type, + ) + + battery_fixed_voltages_input.additional_properties = d + return battery_fixed_voltages_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_output.py b/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_output.py new file mode 100644 index 00000000..32cd00d8 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_fixed_voltages_output.py @@ -0,0 +1,250 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryFixedVoltagesOutput") + + +@_attrs_define +class BatteryFixedVoltagesOutput: + """Battery Fixed Voltages Output.""" + + id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Fixed Voltages Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryFixedVoltages"] | Unset = "BatteryFixedVoltages" + voltage_max: float | Unset = 400.0 + voltage_min: float | None | Unset = UNSET + charge_acceptance_limit: float | None | Unset = UNSET + charge_release_limit: float | None | Unset = UNSET + capacity: float | None | Unset = UNSET + internal_resistance_charge: float | Unset = 0.0 + internal_resistance_discharge: float | Unset = 0.0 + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + voltage_max = self.voltage_max + + voltage_min: float | None | Unset + if isinstance(self.voltage_min, Unset): + voltage_min = UNSET + else: + voltage_min = self.voltage_min + + charge_acceptance_limit: float | None | Unset + if isinstance(self.charge_acceptance_limit, Unset): + charge_acceptance_limit = UNSET + else: + charge_acceptance_limit = self.charge_acceptance_limit + + charge_release_limit: float | None | Unset + if isinstance(self.charge_release_limit, Unset): + charge_release_limit = UNSET + else: + charge_release_limit = self.charge_release_limit + + capacity: float | None | Unset + if isinstance(self.capacity, Unset): + capacity = UNSET + else: + capacity = self.capacity + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if voltage_max is not UNSET: + field_dict["voltage_max"] = voltage_max + if voltage_min is not UNSET: + field_dict["voltage_min"] = voltage_min + if charge_acceptance_limit is not UNSET: + field_dict["charge_acceptance_limit"] = charge_acceptance_limit + if charge_release_limit is not UNSET: + field_dict["charge_release_limit"] = charge_release_limit + if capacity is not UNSET: + field_dict["capacity"] = capacity + if internal_resistance_charge is not UNSET: + field_dict["internal_resistance_charge"] = internal_resistance_charge + if internal_resistance_discharge is not UNSET: + field_dict["internal_resistance_discharge"] = internal_resistance_discharge + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_state import BatteryState + + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["BatteryFixedVoltages"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "BatteryFixedVoltages" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryFixedVoltages', got '{component_type}'" + ) + + voltage_max = d.pop("voltage_max", UNSET) + + def _parse_voltage_min(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage_min = _parse_voltage_min(d.pop("voltage_min", UNSET)) + + def _parse_charge_acceptance_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_acceptance_limit = _parse_charge_acceptance_limit( + d.pop("charge_acceptance_limit", UNSET) + ) + + def _parse_charge_release_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + charge_release_limit = _parse_charge_release_limit(d.pop("charge_release_limit", UNSET)) + + def _parse_capacity(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + capacity = _parse_capacity(d.pop("capacity", UNSET)) + + internal_resistance_charge = d.pop("internal_resistance_charge", UNSET) + + internal_resistance_discharge = d.pop("internal_resistance_discharge", UNSET) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_fixed_voltages_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + voltage_max=voltage_max, + voltage_min=voltage_min, + charge_acceptance_limit=charge_acceptance_limit, + charge_release_limit=charge_release_limit, + capacity=capacity, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + state=state, + part_type=part_type, + ) + + battery_fixed_voltages_output.additional_properties = d + return battery_fixed_voltages_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_lookup_table_data.py b/src/ansys/conceptev/core/generated/models/battery_lookup_table_data.py new file mode 100644 index 00000000..a37d5c6a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_lookup_table_data.py @@ -0,0 +1,175 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatteryLookupTableData") + + +@_attrs_define +class BatteryLookupTableData: + """Data for a lookup table battery.""" + + voltage: list[float] + state_of_charge: list[float] + usable_charge: list[float | None] + power_limit_charge: list[float | None] + power_limit_discharge: list[float | None] + internal_resistance_charge: list[float] + internal_resistance_discharge: list[float] + internal_resistance: list[float] | Unset = UNSET + component_file_type: Literal["BatteryLookupTable"] | Unset = "BatteryLookupTable" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage = self.voltage + + state_of_charge = self.state_of_charge + + usable_charge = [] + for usable_charge_item_data in self.usable_charge: + usable_charge_item: float | None + usable_charge_item = usable_charge_item_data + usable_charge.append(usable_charge_item) + + power_limit_charge = [] + for power_limit_charge_item_data in self.power_limit_charge: + power_limit_charge_item: float | None + power_limit_charge_item = power_limit_charge_item_data + power_limit_charge.append(power_limit_charge_item) + + power_limit_discharge = [] + for power_limit_discharge_item_data in self.power_limit_discharge: + power_limit_discharge_item: float | None + power_limit_discharge_item = power_limit_discharge_item_data + power_limit_discharge.append(power_limit_discharge_item) + + internal_resistance_charge = self.internal_resistance_charge + + internal_resistance_discharge = self.internal_resistance_discharge + + internal_resistance: list[float] | Unset = UNSET + if not isinstance(self.internal_resistance, Unset): + internal_resistance = self.internal_resistance + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "voltage": voltage, + "state_of_charge": state_of_charge, + "usable_charge": usable_charge, + "power_limit_charge": power_limit_charge, + "power_limit_discharge": power_limit_discharge, + "internal_resistance_charge": internal_resistance_charge, + "internal_resistance_discharge": internal_resistance_discharge, + } + ) + if internal_resistance is not UNSET: + field_dict["internal_resistance"] = internal_resistance + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + voltage = cast(list[float], d.pop("voltage")) + + state_of_charge = cast(list[float], d.pop("state_of_charge")) + + usable_charge = [] + _usable_charge = d.pop("usable_charge") + for usable_charge_item_data in _usable_charge: + + def _parse_usable_charge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + usable_charge_item = _parse_usable_charge_item(usable_charge_item_data) + + usable_charge.append(usable_charge_item) + + power_limit_charge = [] + _power_limit_charge = d.pop("power_limit_charge") + for power_limit_charge_item_data in _power_limit_charge: + + def _parse_power_limit_charge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + power_limit_charge_item = _parse_power_limit_charge_item(power_limit_charge_item_data) + + power_limit_charge.append(power_limit_charge_item) + + power_limit_discharge = [] + _power_limit_discharge = d.pop("power_limit_discharge") + for power_limit_discharge_item_data in _power_limit_discharge: + + def _parse_power_limit_discharge_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + power_limit_discharge_item = _parse_power_limit_discharge_item( + power_limit_discharge_item_data + ) + + power_limit_discharge.append(power_limit_discharge_item) + + internal_resistance_charge = cast(list[float], d.pop("internal_resistance_charge")) + + internal_resistance_discharge = cast(list[float], d.pop("internal_resistance_discharge")) + + internal_resistance = cast(list[float], d.pop("internal_resistance", UNSET)) + + component_file_type = cast( + Literal["BatteryLookupTable"] | Unset, d.pop("component_file_type", UNSET) + ) + if component_file_type != "BatteryLookupTable" and not isinstance( + component_file_type, Unset + ): + raise ValueError( + f"component_file_type must match const 'BatteryLookupTable', got '{component_file_type}'" + ) + + battery_lookup_table_data = cls( + voltage=voltage, + state_of_charge=state_of_charge, + usable_charge=usable_charge, + power_limit_charge=power_limit_charge, + power_limit_discharge=power_limit_discharge, + internal_resistance_charge=internal_resistance_charge, + internal_resistance_discharge=internal_resistance_discharge, + internal_resistance=internal_resistance, + component_file_type=component_file_type, + ) + + battery_lookup_table_data.additional_properties = d + return battery_lookup_table_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_lookup_table_input.py b/src/ansys/conceptev/core/generated/models/battery_lookup_table_input.py new file mode 100644 index 00000000..005e2f22 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_lookup_table_input.py @@ -0,0 +1,149 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryLookupTableInput") + + +@_attrs_define +class BatteryLookupTableInput: + """Battery Lookup Table Input.""" + + lookup_table: BatteryLookupTableData + """ Data for a lookup table battery. """ + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Lookup Table Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryLookupData"] | Unset = "BatteryLookupData" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + lookup_table = self.lookup_table.to_dict() + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "lookup_table": lookup_table, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + d = dict(src_dict) + lookup_table = BatteryLookupTableData.from_dict(d.pop("lookup_table")) + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["BatteryLookupData"] | Unset, d.pop("component_type", UNSET)) + if component_type != "BatteryLookupData" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryLookupData', got '{component_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_lookup_table_input = cls( + lookup_table=lookup_table, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + state=state, + part_type=part_type, + ) + + battery_lookup_table_input.additional_properties = d + return battery_lookup_table_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_lookup_table_output.py b/src/ansys/conceptev/core/generated/models/battery_lookup_table_output.py new file mode 100644 index 00000000..f136276b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_lookup_table_output.py @@ -0,0 +1,156 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + +T = TypeVar("T", bound="BatteryLookupTableOutput") + + +@_attrs_define +class BatteryLookupTableOutput: + """Battery Lookup Table Output.""" + + id: str + lookup_table: BatteryLookupTableData + """ Data for a lookup table battery. """ + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Lookup Table Battery" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["BatteryLookupData"] | Unset = "BatteryLookupData" + state: BatteryState | Unset = UNSET + """ Variables that define state of a battery. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + lookup_table = self.lookup_table.to_dict() + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "lookup_table": lookup_table, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if state is not UNSET: + field_dict["state"] = state + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_lookup_table_data import BatteryLookupTableData + from ..models.battery_state import BatteryState + + d = dict(src_dict) + id = d.pop("id") + + lookup_table = BatteryLookupTableData.from_dict(d.pop("lookup_table")) + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["BatteryLookupData"] | Unset, d.pop("component_type", UNSET)) + if component_type != "BatteryLookupData" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'BatteryLookupData', got '{component_type}'" + ) + + _state = d.pop("state", UNSET) + state: BatteryState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = BatteryState.from_dict(_state) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + battery_lookup_table_output = cls( + id=id, + lookup_table=lookup_table, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + state=state, + part_type=part_type, + ) + + battery_lookup_table_output.additional_properties = d + return battery_lookup_table_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/battery_state.py b/src/ansys/conceptev/core/generated/models/battery_state.py new file mode 100644 index 00000000..0c005f43 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/battery_state.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatteryState") + + +@_attrs_define +class BatteryState: + """Variables that define state of a battery.""" + + temperature: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + temperature: float | None | Unset + if isinstance(self.temperature, Unset): + temperature = UNSET + else: + temperature = self.temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if temperature is not UNSET: + field_dict["temperature"] = temperature + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_temperature(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + temperature = _parse_temperature(d.pop("temperature", UNSET)) + + battery_state = cls( + temperature=temperature, + ) + + battery_state.additional_properties = d + return battery_state + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/body_create_file_item.py b/src/ansys/conceptev/core/generated/models/body_create_file_item.py new file mode 100644 index 00000000..8dc9194b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/body_create_file_item.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="BodyCreateFileItem") + + +@_attrs_define +class BodyCreateFileItem: + file: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + file = self.file + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "file": file, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("file", (None, str(self.file).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + file = d.pop("file") + + body_create_file_item = cls( + file=file, + ) + + body_create_file_item.additional_properties = d + return body_create_file_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/check_job_backend_availability_response_check_job_backend_availability.py b/src/ansys/conceptev/core/generated/models/check_job_backend_availability_response_check_job_backend_availability.py new file mode 100644 index 00000000..ece5cb71 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/check_job_backend_availability_response_check_job_backend_availability.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CheckJobBackendAvailabilityResponseCheckJobBackendAvailability") + + +@_attrs_define +class CheckJobBackendAvailabilityResponseCheckJobBackendAvailability: + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + check_job_backend_availability_response_check_job_backend_availability = cls() + + check_job_backend_availability_response_check_job_backend_availability.additional_properties = ( + d + ) + return check_job_backend_availability_response_check_job_backend_availability + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/component_axle.py b/src/ansys/conceptev/core/generated/models/component_axle.py new file mode 100644 index 00000000..343d676f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/component_axle.py @@ -0,0 +1,15 @@ +from typing import Literal + +ComponentAxle = Literal["Front", "None", "Rear"] + +COMPONENT_AXLE_VALUES: set[ComponentAxle] = { + "Front", + "None", + "Rear", +} + + +def check_component_axle(value: str) -> ComponentAxle: + if value in COMPONENT_AXLE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {COMPONENT_AXLE_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/component_configuration_set.py b/src/ansys/conceptev/core/generated/models/component_configuration_set.py new file mode 100644 index 00000000..beb6aaf9 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/component_configuration_set.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.battery_configuration import BatteryConfiguration + from ..models.motor_configuration import MotorConfiguration + + +T = TypeVar("T", bound="ComponentConfigurationSet") + + +@_attrs_define +class ComponentConfigurationSet: + """Set of component configurations.""" + + configurations: list[BatteryConfiguration | MotorConfiguration] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_configuration import MotorConfiguration + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, MotorConfiguration): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if configurations is not UNSET: + field_dict["configurations"] = configurations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.battery_configuration import BatteryConfiguration + from ..models.motor_configuration import MotorConfiguration + + d = dict(src_dict) + _configurations = d.pop("configurations", UNSET) + configurations: list[BatteryConfiguration | MotorConfiguration] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item( + data: object, + ) -> BatteryConfiguration | MotorConfiguration: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = MotorConfiguration.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = BatteryConfiguration.from_dict(data) + + return configurations_item_type_1 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + component_configuration_set = cls( + configurations=configurations, + ) + + component_configuration_set.additional_properties = d + return component_configuration_set + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/component_file_type.py b/src/ansys/conceptev/core/generated/models/component_file_type.py new file mode 100644 index 00000000..924fa91b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/component_file_type.py @@ -0,0 +1,29 @@ +from typing import Literal + +ComponentFileType = Literal[ + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "thermal_model_file", + "transmission_torque_grid_file", +] + +COMPONENT_FILE_TYPE_VALUES: set[ComponentFileType] = { + "battery_lookup_file", + "drive_cycle_file", + "inverter_loss_file", + "motor_lab_file", + "motor_torque_grid_file", + "motor_torque_speed_file", + "thermal_model_file", + "transmission_torque_grid_file", +} + + +def check_component_file_type(value: str) -> ComponentFileType: + if value in COMPONENT_FILE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {COMPONENT_FILE_TYPE_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/component_loss_map_args.py b/src/ansys/conceptev/core/generated/models/component_loss_map_args.py new file mode 100644 index 00000000..fbe6da44 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/component_loss_map_args.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ComponentLossMapArgs") + + +@_attrs_define +class ComponentLossMapArgs: + """Args for create component loss maps. + + Allows unit transforming. + + """ + + voltage: float | None | Unset = UNSET + gear_ratio: float | None | Unset = UNSET + speed: float | None | Unset = UNSET + dc_current: float | Unset = 50.0 + power_factor: float | Unset = 1.0 + phase_current_max: float | Unset = 400.0 + frequency: float | Unset = 1000.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage: float | None | Unset + if isinstance(self.voltage, Unset): + voltage = UNSET + else: + voltage = self.voltage + + gear_ratio: float | None | Unset + if isinstance(self.gear_ratio, Unset): + gear_ratio = UNSET + else: + gear_ratio = self.gear_ratio + + speed: float | None | Unset + if isinstance(self.speed, Unset): + speed = UNSET + else: + speed = self.speed + + dc_current = self.dc_current + + power_factor = self.power_factor + + phase_current_max = self.phase_current_max + + frequency = self.frequency + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if voltage is not UNSET: + field_dict["voltage"] = voltage + if gear_ratio is not UNSET: + field_dict["gear_ratio"] = gear_ratio + if speed is not UNSET: + field_dict["speed"] = speed + if dc_current is not UNSET: + field_dict["dc_current"] = dc_current + if power_factor is not UNSET: + field_dict["power_factor"] = power_factor + if phase_current_max is not UNSET: + field_dict["phase_current_max"] = phase_current_max + if frequency is not UNSET: + field_dict["frequency"] = frequency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_voltage(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + voltage = _parse_voltage(d.pop("voltage", UNSET)) + + def _parse_gear_ratio(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + gear_ratio = _parse_gear_ratio(d.pop("gear_ratio", UNSET)) + + def _parse_speed(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + speed = _parse_speed(d.pop("speed", UNSET)) + + dc_current = d.pop("dc_current", UNSET) + + power_factor = d.pop("power_factor", UNSET) + + phase_current_max = d.pop("phase_current_max", UNSET) + + frequency = d.pop("frequency", UNSET) + + component_loss_map_args = cls( + voltage=voltage, + gear_ratio=gear_ratio, + speed=speed, + dc_current=dc_current, + power_factor=power_factor, + phase_current_max=phase_current_max, + frequency=frequency, + ) + + component_loss_map_args.additional_properties = d + return component_loss_map_args + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/concept_input.py b/src/ansys/conceptev/core/generated/models/concept_input.py new file mode 100644 index 00000000..b2c2aa38 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/concept_input.py @@ -0,0 +1,425 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero_input import AeroInput + from ..models.architecture_input import ArchitectureInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_input import DriveCycleInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.file_item_output import FileItemOutput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + from ..models.static_requirement_input import StaticRequirementInput + from ..models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput + from ..models.wheel_input import WheelInput + + +T = TypeVar("T", bound="ConceptInput") + + +@_attrs_define +class ConceptInput: + """Concept input — uses input variants of each part group.""" + + name: str | Unset = "Study" + user_id: None | str | Unset = UNSET + project_id: None | str | Unset = UNSET + design_id: None | str | Unset = UNSET + design_instance_id: None | str | Unset = UNSET + file_items: list[FileItemOutput] | Unset = UNSET + components: ( + list[ + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ] + | Unset + ) = UNSET + configurations: list[AeroInput | MassInput | WheelInput] | Unset = UNSET + architectures: list[ArchitectureInput] | Unset = UNSET + requirements: ( + list[DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput] | Unset + ) = UNSET + drive_cycles: list[DriveCycleInput] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero_input import AeroInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + + name = self.name + + user_id: None | str | Unset + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + project_id: None | str | Unset + if isinstance(self.project_id, Unset): + project_id = UNSET + else: + project_id = self.project_id + + design_id: None | str | Unset + if isinstance(self.design_id, Unset): + design_id = UNSET + else: + design_id = self.design_id + + design_instance_id: None | str | Unset + if isinstance(self.design_instance_id, Unset): + design_instance_id = UNSET + else: + design_instance_id = self.design_instance_id + + file_items: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.file_items, Unset): + file_items = [] + for file_items_item_data in self.file_items: + file_items_item = file_items_item_data.to_dict() + file_items.append(file_items_item) + + components: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.components, Unset): + components = [] + for components_item_data in self.components: + components_item: dict[str, Any] + if isinstance(components_item_data, MotorLabInput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryFixedVoltagesInput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryLookupTableInput): + components_item = components_item_data.to_dict() + else: + components_item = components_item_data.to_dict() + + components.append(components_item) + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, AeroInput): + configurations_item = configurations_item_data.to_dict() + elif isinstance(configurations_item_data, MassInput): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + architectures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.architectures, Unset): + architectures = [] + for architectures_item_data in self.architectures: + architectures_item = architectures_item_data.to_dict() + architectures.append(architectures_item) + + requirements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.requirements, Unset): + requirements = [] + for requirements_item_data in self.requirements: + requirements_item: dict[str, Any] + if isinstance(requirements_item_data, DriveCycleRequirementInput): + requirements_item = requirements_item_data.to_dict() + elif isinstance(requirements_item_data, DynamicRequirementInput): + requirements_item = requirements_item_data.to_dict() + else: + requirements_item = requirements_item_data.to_dict() + + requirements.append(requirements_item) + + drive_cycles: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.drive_cycles, Unset): + drive_cycles = [] + for drive_cycles_item_data in self.drive_cycles: + drive_cycles_item = drive_cycles_item_data.to_dict() + drive_cycles.append(drive_cycles_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if user_id is not UNSET: + field_dict["user_id"] = user_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if design_id is not UNSET: + field_dict["design_id"] = design_id + if design_instance_id is not UNSET: + field_dict["design_instance_id"] = design_instance_id + if file_items is not UNSET: + field_dict["file_items"] = file_items + if components is not UNSET: + field_dict["components"] = components + if configurations is not UNSET: + field_dict["configurations"] = configurations + if architectures is not UNSET: + field_dict["architectures"] = architectures + if requirements is not UNSET: + field_dict["requirements"] = requirements + if drive_cycles is not UNSET: + field_dict["drive_cycles"] = drive_cycles + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero_input import AeroInput + from ..models.architecture_input import ArchitectureInput + from ..models.battery_fixed_voltages_input import BatteryFixedVoltagesInput + from ..models.battery_lookup_table_input import BatteryLookupTableInput + from ..models.drive_cycle_input import DriveCycleInput + from ..models.drive_cycle_requirement_input import DriveCycleRequirementInput + from ..models.dynamic_requirement_input import DynamicRequirementInput + from ..models.file_item_output import FileItemOutput + from ..models.mass_input import MassInput + from ..models.motor_lab_input import MotorLabInput + from ..models.static_requirement_input import StaticRequirementInput + from ..models.transmission_loss_coefficients_input import TransmissionLossCoefficientsInput + from ..models.wheel_input import WheelInput + + d = dict(src_dict) + name = d.pop("name", UNSET) + + def _parse_user_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + def _parse_project_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + project_id = _parse_project_id(d.pop("project_id", UNSET)) + + def _parse_design_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_id = _parse_design_id(d.pop("design_id", UNSET)) + + def _parse_design_instance_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_instance_id = _parse_design_instance_id(d.pop("design_instance_id", UNSET)) + + _file_items = d.pop("file_items", UNSET) + file_items: list[FileItemOutput] | Unset = UNSET + if _file_items is not UNSET: + file_items = [] + for file_items_item_data in _file_items: + file_items_item = FileItemOutput.from_dict(file_items_item_data) + + file_items.append(file_items_item) + + _components = d.pop("components", UNSET) + components: ( + list[ + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ] + | Unset + ) = UNSET + if _components is not UNSET: + components = [] + for components_item_data in _components: + + def _parse_components_item( + data: object, + ) -> ( + BatteryFixedVoltagesInput + | BatteryLookupTableInput + | MotorLabInput + | TransmissionLossCoefficientsInput + ): + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_0 = MotorLabInput.from_dict(data) + + return components_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_1 = BatteryFixedVoltagesInput.from_dict(data) + + return components_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_2 = BatteryLookupTableInput.from_dict(data) + + return components_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + components_item_type_3 = TransmissionLossCoefficientsInput.from_dict(data) + + return components_item_type_3 + + components_item = _parse_components_item(components_item_data) + + components.append(components_item) + + _configurations = d.pop("configurations", UNSET) + configurations: list[AeroInput | MassInput | WheelInput] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item(data: object) -> AeroInput | MassInput | WheelInput: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = AeroInput.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = MassInput.from_dict(data) + + return configurations_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_2 = WheelInput.from_dict(data) + + return configurations_item_type_2 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + _architectures = d.pop("architectures", UNSET) + architectures: list[ArchitectureInput] | Unset = UNSET + if _architectures is not UNSET: + architectures = [] + for architectures_item_data in _architectures: + architectures_item = ArchitectureInput.from_dict(architectures_item_data) + + architectures.append(architectures_item) + + _requirements = d.pop("requirements", UNSET) + requirements: ( + list[DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput] + | Unset + ) = UNSET + if _requirements is not UNSET: + requirements = [] + for requirements_item_data in _requirements: + + def _parse_requirements_item( + data: object, + ) -> DriveCycleRequirementInput | DynamicRequirementInput | StaticRequirementInput: + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_0 = DriveCycleRequirementInput.from_dict(data) + + return requirements_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_1 = DynamicRequirementInput.from_dict(data) + + return requirements_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_2 = StaticRequirementInput.from_dict(data) + + return requirements_item_type_2 + + requirements_item = _parse_requirements_item(requirements_item_data) + + requirements.append(requirements_item) + + _drive_cycles = d.pop("drive_cycles", UNSET) + drive_cycles: list[DriveCycleInput] | Unset = UNSET + if _drive_cycles is not UNSET: + drive_cycles = [] + for drive_cycles_item_data in _drive_cycles: + drive_cycles_item = DriveCycleInput.from_dict(drive_cycles_item_data) + + drive_cycles.append(drive_cycles_item) + + concept_input = cls( + name=name, + user_id=user_id, + project_id=project_id, + design_id=design_id, + design_instance_id=design_instance_id, + file_items=file_items, + components=components, + configurations=configurations, + architectures=architectures, + requirements=requirements, + drive_cycles=drive_cycles, + ) + + concept_input.additional_properties = d + return concept_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/concept_job_record.py b/src/ansys/conceptev/core/generated/models/concept_job_record.py new file mode 100644 index 00000000..e7a121fb --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/concept_job_record.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ConceptJobRecord") + + +@_attrs_define +class ConceptJobRecord: + """A job record stored as a part inside a concept. + + Tracks backend job status and the output file URLs written by the solver. + Stored under PartType.JOB so it uses the same CRUD path as all other parts. + + """ + + id: str + name: str + part_type: Literal["job"] | Unset = "job" + status: str | Unset = "RUNNING" + output_urls: list[str] | Unset = UNSET + error: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + part_type = self.part_type + + status = self.status + + output_urls: list[str] | Unset = UNSET + if not isinstance(self.output_urls, Unset): + output_urls = self.output_urls + + error: None | str | Unset + if isinstance(self.error, Unset): + error = UNSET + else: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if status is not UNSET: + field_dict["status"] = status + if output_urls is not UNSET: + field_dict["output_urls"] = output_urls + if error is not UNSET: + field_dict["error"] = error + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + part_type = cast(Literal["job"] | Unset, d.pop("part_type", UNSET)) + if part_type != "job" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'job', got '{part_type}'") + + status = d.pop("status", UNSET) + + output_urls = cast(list[str], d.pop("output_urls", UNSET)) + + def _parse_error(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + error = _parse_error(d.pop("error", UNSET)) + + concept_job_record = cls( + id=id, + name=name, + part_type=part_type, + status=status, + output_urls=output_urls, + error=error, + ) + + concept_job_record.additional_properties = d + return concept_job_record + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/concept_output.py b/src/ansys/conceptev/core/generated/models/concept_output.py new file mode 100644 index 00000000..1b611ed8 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/concept_output.py @@ -0,0 +1,489 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.save_state import SaveState, check_save_state +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero_output import AeroOutput + from ..models.architecture_output import ArchitectureOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.concept_job_record import ConceptJobRecord + from ..models.drive_cycle_output import DriveCycleOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.file_item_output import FileItemOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + from ..models.static_requirement_output import StaticRequirementOutput + from ..models.transmission_loss_coefficients_output import TransmissionLossCoefficientsOutput + from ..models.wheel_output import WheelOutput + + +T = TypeVar("T", bound="ConceptOutput") + + +@_attrs_define +class ConceptOutput: + """Concept output with database ID — uses output variants of each part group.""" + + id: str + name: str | Unset = "Study" + user_id: None | str | Unset = UNSET + project_id: None | str | Unset = UNSET + design_id: None | str | Unset = UNSET + design_instance_id: None | str | Unset = UNSET + file_items: list[FileItemOutput] | Unset = UNSET + save_state: SaveState | Unset = UNSET + """ Persistence state of a concept on the filesystem. + + ``UNSAVED`` — concept was created in this session and has never been + written to a user-chosen path (the default for new concepts). + + ``SAVED`` — concept has been explicitly saved to a known path. + + Extending example: add ``MODIFIED`` here when tracking unsaved edits + to an already-saved concept ("dirty" state). """ + components: ( + list[ + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ] + | Unset + ) = UNSET + configurations: list[AeroOutput | MassOutput | WheelOutput] | Unset = UNSET + architectures: list[ArchitectureOutput] | Unset = UNSET + requirements: ( + list[DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput] + | Unset + ) = UNSET + drive_cycles: list[DriveCycleOutput] | Unset = UNSET + jobs: list[ConceptJobRecord] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero_output import AeroOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + + id = self.id + + name = self.name + + user_id: None | str | Unset + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + project_id: None | str | Unset + if isinstance(self.project_id, Unset): + project_id = UNSET + else: + project_id = self.project_id + + design_id: None | str | Unset + if isinstance(self.design_id, Unset): + design_id = UNSET + else: + design_id = self.design_id + + design_instance_id: None | str | Unset + if isinstance(self.design_instance_id, Unset): + design_instance_id = UNSET + else: + design_instance_id = self.design_instance_id + + file_items: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.file_items, Unset): + file_items = [] + for file_items_item_data in self.file_items: + file_items_item = file_items_item_data.to_dict() + file_items.append(file_items_item) + + save_state: str | Unset = UNSET + if not isinstance(self.save_state, Unset): + save_state = self.save_state + + components: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.components, Unset): + components = [] + for components_item_data in self.components: + components_item: dict[str, Any] + if isinstance(components_item_data, MotorLabOutput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryFixedVoltagesOutput): + components_item = components_item_data.to_dict() + elif isinstance(components_item_data, BatteryLookupTableOutput): + components_item = components_item_data.to_dict() + else: + components_item = components_item_data.to_dict() + + components.append(components_item) + + configurations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.configurations, Unset): + configurations = [] + for configurations_item_data in self.configurations: + configurations_item: dict[str, Any] + if isinstance(configurations_item_data, AeroOutput): + configurations_item = configurations_item_data.to_dict() + elif isinstance(configurations_item_data, MassOutput): + configurations_item = configurations_item_data.to_dict() + else: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + architectures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.architectures, Unset): + architectures = [] + for architectures_item_data in self.architectures: + architectures_item = architectures_item_data.to_dict() + architectures.append(architectures_item) + + requirements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.requirements, Unset): + requirements = [] + for requirements_item_data in self.requirements: + requirements_item: dict[str, Any] + if isinstance(requirements_item_data, DriveCycleRequirementOutput): + requirements_item = requirements_item_data.to_dict() + elif isinstance(requirements_item_data, DynamicRequirementOutput): + requirements_item = requirements_item_data.to_dict() + else: + requirements_item = requirements_item_data.to_dict() + + requirements.append(requirements_item) + + drive_cycles: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.drive_cycles, Unset): + drive_cycles = [] + for drive_cycles_item_data in self.drive_cycles: + drive_cycles_item = drive_cycles_item_data.to_dict() + drive_cycles.append(drive_cycles_item) + + jobs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.jobs, Unset): + jobs = [] + for jobs_item_data in self.jobs: + jobs_item = jobs_item_data.to_dict() + jobs.append(jobs_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if name is not UNSET: + field_dict["name"] = name + if user_id is not UNSET: + field_dict["user_id"] = user_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if design_id is not UNSET: + field_dict["design_id"] = design_id + if design_instance_id is not UNSET: + field_dict["design_instance_id"] = design_instance_id + if file_items is not UNSET: + field_dict["file_items"] = file_items + if save_state is not UNSET: + field_dict["save_state"] = save_state + if components is not UNSET: + field_dict["components"] = components + if configurations is not UNSET: + field_dict["configurations"] = configurations + if architectures is not UNSET: + field_dict["architectures"] = architectures + if requirements is not UNSET: + field_dict["requirements"] = requirements + if drive_cycles is not UNSET: + field_dict["drive_cycles"] = drive_cycles + if jobs is not UNSET: + field_dict["jobs"] = jobs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero_output import AeroOutput + from ..models.architecture_output import ArchitectureOutput + from ..models.battery_fixed_voltages_output import BatteryFixedVoltagesOutput + from ..models.battery_lookup_table_output import BatteryLookupTableOutput + from ..models.concept_job_record import ConceptJobRecord + from ..models.drive_cycle_output import DriveCycleOutput + from ..models.drive_cycle_requirement_output import DriveCycleRequirementOutput + from ..models.dynamic_requirement_output import DynamicRequirementOutput + from ..models.file_item_output import FileItemOutput + from ..models.mass_output import MassOutput + from ..models.motor_lab_output import MotorLabOutput + from ..models.static_requirement_output import StaticRequirementOutput + from ..models.transmission_loss_coefficients_output import ( + TransmissionLossCoefficientsOutput, + ) + from ..models.wheel_output import WheelOutput + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name", UNSET) + + def _parse_user_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + def _parse_project_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + project_id = _parse_project_id(d.pop("project_id", UNSET)) + + def _parse_design_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_id = _parse_design_id(d.pop("design_id", UNSET)) + + def _parse_design_instance_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + design_instance_id = _parse_design_instance_id(d.pop("design_instance_id", UNSET)) + + _file_items = d.pop("file_items", UNSET) + file_items: list[FileItemOutput] | Unset = UNSET + if _file_items is not UNSET: + file_items = [] + for file_items_item_data in _file_items: + file_items_item = FileItemOutput.from_dict(file_items_item_data) + + file_items.append(file_items_item) + + _save_state = d.pop("save_state", UNSET) + save_state: SaveState | Unset + if isinstance(_save_state, Unset): + save_state = UNSET + else: + save_state = check_save_state(_save_state) + + _components = d.pop("components", UNSET) + components: ( + list[ + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ] + | Unset + ) = UNSET + if _components is not UNSET: + components = [] + for components_item_data in _components: + + def _parse_components_item( + data: object, + ) -> ( + BatteryFixedVoltagesOutput + | BatteryLookupTableOutput + | MotorLabOutput + | TransmissionLossCoefficientsOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_0 = MotorLabOutput.from_dict(data) + + return components_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_1 = BatteryFixedVoltagesOutput.from_dict(data) + + return components_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + components_item_type_2 = BatteryLookupTableOutput.from_dict(data) + + return components_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + components_item_type_3 = TransmissionLossCoefficientsOutput.from_dict(data) + + return components_item_type_3 + + components_item = _parse_components_item(components_item_data) + + components.append(components_item) + + _configurations = d.pop("configurations", UNSET) + configurations: list[AeroOutput | MassOutput | WheelOutput] | Unset = UNSET + if _configurations is not UNSET: + configurations = [] + for configurations_item_data in _configurations: + + def _parse_configurations_item( + data: object, + ) -> AeroOutput | MassOutput | WheelOutput: + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_0 = AeroOutput.from_dict(data) + + return configurations_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_1 = MassOutput.from_dict(data) + + return configurations_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + configurations_item_type_2 = WheelOutput.from_dict(data) + + return configurations_item_type_2 + + configurations_item = _parse_configurations_item(configurations_item_data) + + configurations.append(configurations_item) + + _architectures = d.pop("architectures", UNSET) + architectures: list[ArchitectureOutput] | Unset = UNSET + if _architectures is not UNSET: + architectures = [] + for architectures_item_data in _architectures: + architectures_item = ArchitectureOutput.from_dict(architectures_item_data) + + architectures.append(architectures_item) + + _requirements = d.pop("requirements", UNSET) + requirements: ( + list[DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput] + | Unset + ) = UNSET + if _requirements is not UNSET: + requirements = [] + for requirements_item_data in _requirements: + + def _parse_requirements_item( + data: object, + ) -> ( + DriveCycleRequirementOutput | DynamicRequirementOutput | StaticRequirementOutput + ): + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_0 = DriveCycleRequirementOutput.from_dict(data) + + return requirements_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_1 = DynamicRequirementOutput.from_dict(data) + + return requirements_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + requirements_item_type_2 = StaticRequirementOutput.from_dict(data) + + return requirements_item_type_2 + + requirements_item = _parse_requirements_item(requirements_item_data) + + requirements.append(requirements_item) + + _drive_cycles = d.pop("drive_cycles", UNSET) + drive_cycles: list[DriveCycleOutput] | Unset = UNSET + if _drive_cycles is not UNSET: + drive_cycles = [] + for drive_cycles_item_data in _drive_cycles: + drive_cycles_item = DriveCycleOutput.from_dict(drive_cycles_item_data) + + drive_cycles.append(drive_cycles_item) + + _jobs = d.pop("jobs", UNSET) + jobs: list[ConceptJobRecord] | Unset = UNSET + if _jobs is not UNSET: + jobs = [] + for jobs_item_data in _jobs: + jobs_item = ConceptJobRecord.from_dict(jobs_item_data) + + jobs.append(jobs_item) + + concept_output = cls( + id=id, + name=name, + user_id=user_id, + project_id=project_id, + design_id=design_id, + design_instance_id=design_instance_id, + file_items=file_items, + save_state=save_state, + components=components, + configurations=configurations, + architectures=architectures, + requirements=requirements, + drive_cycles=drive_cycles, + jobs=jobs, + ) + + concept_output.additional_properties = d + return concept_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/concept_save_request.py b/src/ansys/conceptev/core/generated/models/concept_save_request.py new file mode 100644 index 00000000..97d2f8af --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/concept_save_request.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ConceptSaveRequest") + + +@_attrs_define +class ConceptSaveRequest: + """Request body for the save-concept endpoint.""" + + path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + path = self.path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "path": path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + path = d.pop("path") + + concept_save_request = cls( + path=path, + ) + + concept_save_request.additional_properties = d + return concept_save_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/current_unit.py b/src/ansys/conceptev/core/generated/models/current_unit.py new file mode 100644 index 00000000..2beb9cd7 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/current_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +CurrentUnit = Literal["A", "kA", "mA"] + +CURRENT_UNIT_VALUES: set[CurrentUnit] = { + "A", + "kA", + "mA", +} + + +def check_current_unit(value: str) -> CurrentUnit: + if value in CURRENT_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CURRENT_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/density_unit.py b/src/ansys/conceptev/core/generated/models/density_unit.py new file mode 100644 index 00000000..cca43569 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/density_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +DensityUnit = Literal["g/cm³", "kg/m³"] + +DENSITY_UNIT_VALUES: set[DensityUnit] = { + "g/cm³", + "kg/m³", +} + + +def check_density_unit(value: str) -> DensityUnit: + if value in DENSITY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DENSITY_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/drive_cycle_input.py b/src/ansys/conceptev/core/generated/models/drive_cycle_input.py new file mode 100644 index 00000000..73b0dd02 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/drive_cycle_input.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DriveCycleInput") + + +@_attrs_define +class DriveCycleInput: + """Drive Cycle Input. + + Upload the raw drive cycle data (CSV or JSON export from the solver) as a + file first, then create a ``DriveCycleInput`` referencing that file via + ``drive_cycle_data_id``. The ``points`` field is excluded from storage. + + """ + + drive_cycle_data_id: str + item_type: Literal["drive_cycle"] | Unset = "drive_cycle" + name: str | Unset = "" + points: list[Any] | Unset = UNSET + part_type: Literal["drive_cycle"] | Unset = "drive_cycle" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + drive_cycle_data_id = self.drive_cycle_data_id + + item_type = self.item_type + + name = self.name + + points: list[Any] | Unset = UNSET + if not isinstance(self.points, Unset): + points = self.points + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "drive_cycle_data_id": drive_cycle_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if points is not UNSET: + field_dict["points"] = points + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + drive_cycle_data_id = d.pop("drive_cycle_data_id") + + item_type = cast(Literal["drive_cycle"] | Unset, d.pop("item_type", UNSET)) + if item_type != "drive_cycle" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'drive_cycle', got '{item_type}'") + + name = d.pop("name", UNSET) + + points = cast(list[Any], d.pop("points", UNSET)) + + part_type = cast(Literal["drive_cycle"] | Unset, d.pop("part_type", UNSET)) + if part_type != "drive_cycle" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'drive_cycle', got '{part_type}'") + + drive_cycle_input = cls( + drive_cycle_data_id=drive_cycle_data_id, + item_type=item_type, + name=name, + points=points, + part_type=part_type, + ) + + drive_cycle_input.additional_properties = d + return drive_cycle_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/drive_cycle_output.py b/src/ansys/conceptev/core/generated/models/drive_cycle_output.py new file mode 100644 index 00000000..f59d7647 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/drive_cycle_output.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DriveCycleOutput") + + +@_attrs_define +class DriveCycleOutput: + """Drive Cycle Output. + + The raw time-series data (``points``) is stored in a separate file + referenced by ``drive_cycle_data_id``, mirroring the pattern used by + :class:`~src.v2.models.components.MotorLabOutput`. The ``points`` field + is excluded from the concept record so that large point arrays do not bloat + the concept JSON. + + """ + + id: str + drive_cycle_data_id: str + item_type: Literal["drive_cycle"] | Unset = "drive_cycle" + name: str | Unset = "" + points: list[Any] | Unset = UNSET + part_type: Literal["drive_cycle"] | Unset = "drive_cycle" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + drive_cycle_data_id = self.drive_cycle_data_id + + item_type = self.item_type + + name = self.name + + points: list[Any] | Unset = UNSET + if not isinstance(self.points, Unset): + points = self.points + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "drive_cycle_data_id": drive_cycle_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if points is not UNSET: + field_dict["points"] = points + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + drive_cycle_data_id = d.pop("drive_cycle_data_id") + + item_type = cast(Literal["drive_cycle"] | Unset, d.pop("item_type", UNSET)) + if item_type != "drive_cycle" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'drive_cycle', got '{item_type}'") + + name = d.pop("name", UNSET) + + points = cast(list[Any], d.pop("points", UNSET)) + + part_type = cast(Literal["drive_cycle"] | Unset, d.pop("part_type", UNSET)) + if part_type != "drive_cycle" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'drive_cycle', got '{part_type}'") + + drive_cycle_output = cls( + id=id, + drive_cycle_data_id=drive_cycle_data_id, + item_type=item_type, + name=name, + points=points, + part_type=part_type, + ) + + drive_cycle_output.additional_properties = d + return drive_cycle_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_input.py b/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_input.py new file mode 100644 index 00000000..a7feec06 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_input.py @@ -0,0 +1,330 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DriveCycleRequirementInput") + + +@_attrs_define +class DriveCycleRequirementInput: + """Drive Cycle Requirement Input.""" + + aero_id: str + mass_id: str + wheel_id: str + drive_cycle_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "Requirement" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + requirement_input_type: Literal["drive_cycle"] | Unset = "drive_cycle" + requirement_type: Literal["drive_cycle"] | Unset = "drive_cycle" + solver_id: int | Unset = -1 + drive_cycle: Any | Unset = UNSET + range_: float | None | Unset = UNSET + full_range_calculation: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + drive_cycle_id = self.drive_cycle_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + requirement_input_type = self.requirement_input_type + + requirement_type = self.requirement_type + + solver_id = self.solver_id + + drive_cycle = self.drive_cycle + + range_: float | None | Unset + if isinstance(self.range_, Unset): + range_ = UNSET + else: + range_ = self.range_ + + full_range_calculation = self.full_range_calculation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "drive_cycle_id": drive_cycle_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if requirement_type is not UNSET: + field_dict["requirement_type"] = requirement_type + if solver_id is not UNSET: + field_dict["solver_id"] = solver_id + if drive_cycle is not UNSET: + field_dict["drive_cycle"] = drive_cycle + if range_ is not UNSET: + field_dict["range"] = range_ + if full_range_calculation is not UNSET: + field_dict["full_range_calculation"] = full_range_calculation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + drive_cycle_id = d.pop("drive_cycle_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + requirement_input_type = cast( + Literal["drive_cycle"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "drive_cycle" and not isinstance( + requirement_input_type, Unset + ): + raise ValueError( + f"requirement_input_type must match const 'drive_cycle', got '{requirement_input_type}'" + ) + + requirement_type = cast(Literal["drive_cycle"] | Unset, d.pop("requirement_type", UNSET)) + if requirement_type != "drive_cycle" and not isinstance(requirement_type, Unset): + raise ValueError( + f"requirement_type must match const 'drive_cycle', got '{requirement_type}'" + ) + + solver_id = d.pop("solver_id", UNSET) + + drive_cycle = d.pop("drive_cycle", UNSET) + + def _parse_range_(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + range_ = _parse_range_(d.pop("range", UNSET)) + + full_range_calculation = d.pop("full_range_calculation", UNSET) + + drive_cycle_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + drive_cycle_id=drive_cycle_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + requirement_input_type=requirement_input_type, + requirement_type=requirement_type, + solver_id=solver_id, + drive_cycle=drive_cycle, + range_=range_, + full_range_calculation=full_range_calculation, + ) + + drive_cycle_requirement_input.additional_properties = d + return drive_cycle_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_output.py b/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_output.py new file mode 100644 index 00000000..ad800f75 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/drive_cycle_requirement_output.py @@ -0,0 +1,337 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DriveCycleRequirementOutput") + + +@_attrs_define +class DriveCycleRequirementOutput: + """Drive Cycle Requirement Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + drive_cycle_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "Requirement" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + requirement_input_type: Literal["drive_cycle"] | Unset = "drive_cycle" + requirement_type: Literal["drive_cycle"] | Unset = "drive_cycle" + solver_id: int | Unset = -1 + drive_cycle: Any | Unset = UNSET + range_: float | None | Unset = UNSET + full_range_calculation: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + drive_cycle_id = self.drive_cycle_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + requirement_input_type = self.requirement_input_type + + requirement_type = self.requirement_type + + solver_id = self.solver_id + + drive_cycle = self.drive_cycle + + range_: float | None | Unset + if isinstance(self.range_, Unset): + range_ = UNSET + else: + range_ = self.range_ + + full_range_calculation = self.full_range_calculation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "drive_cycle_id": drive_cycle_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if requirement_type is not UNSET: + field_dict["requirement_type"] = requirement_type + if solver_id is not UNSET: + field_dict["solver_id"] = solver_id + if drive_cycle is not UNSET: + field_dict["drive_cycle"] = drive_cycle + if range_ is not UNSET: + field_dict["range"] = range_ + if full_range_calculation is not UNSET: + field_dict["full_range_calculation"] = full_range_calculation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + drive_cycle_id = d.pop("drive_cycle_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + requirement_input_type = cast( + Literal["drive_cycle"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "drive_cycle" and not isinstance( + requirement_input_type, Unset + ): + raise ValueError( + f"requirement_input_type must match const 'drive_cycle', got '{requirement_input_type}'" + ) + + requirement_type = cast(Literal["drive_cycle"] | Unset, d.pop("requirement_type", UNSET)) + if requirement_type != "drive_cycle" and not isinstance(requirement_type, Unset): + raise ValueError( + f"requirement_type must match const 'drive_cycle', got '{requirement_type}'" + ) + + solver_id = d.pop("solver_id", UNSET) + + drive_cycle = d.pop("drive_cycle", UNSET) + + def _parse_range_(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + range_ = _parse_range_(d.pop("range", UNSET)) + + full_range_calculation = d.pop("full_range_calculation", UNSET) + + drive_cycle_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + drive_cycle_id=drive_cycle_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + requirement_input_type=requirement_input_type, + requirement_type=requirement_type, + solver_id=solver_id, + drive_cycle=drive_cycle, + range_=range_, + full_range_calculation=full_range_calculation, + ) + + drive_cycle_requirement_output.additional_properties = d + return drive_cycle_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/dynamic_requirement_input.py b/src/ansys/conceptev/core/generated/models/dynamic_requirement_input.py new file mode 100644 index 00000000..0db5f8ff --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/dynamic_requirement_input.py @@ -0,0 +1,373 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DynamicRequirementInput") + + +@_attrs_define +class DynamicRequirementInput: + """Dynamic Requirement Input.""" + + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "D1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + from_speed: float | Unset = 0.0 + to_speed: float | Unset = 1.0 + time_step: float | Unset = 0.1 + no_of_points: int | Unset = 6 + base_speed_ratio: float | Unset = 0.5 + required_time: float | Unset = 10000000000.0 + required_distance: float | Unset = 10000000000.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + max_capability: bool | Unset = False + front_axle_split: float | None | Unset = UNSET + requirement_input_type: Literal["dynamic"] | Unset = "dynamic" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + from_speed = self.from_speed + + to_speed = self.to_speed + + time_step = self.time_step + + no_of_points = self.no_of_points + + base_speed_ratio = self.base_speed_ratio + + required_time = self.required_time + + required_distance = self.required_distance + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + max_capability = self.max_capability + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if from_speed is not UNSET: + field_dict["from_speed"] = from_speed + if to_speed is not UNSET: + field_dict["to_speed"] = to_speed + if time_step is not UNSET: + field_dict["time_step"] = time_step + if no_of_points is not UNSET: + field_dict["no_of_points"] = no_of_points + if base_speed_ratio is not UNSET: + field_dict["base_speed_ratio"] = base_speed_ratio + if required_time is not UNSET: + field_dict["required_time"] = required_time + if required_distance is not UNSET: + field_dict["required_distance"] = required_distance + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if max_capability is not UNSET: + field_dict["max_capability"] = max_capability + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + from_speed = d.pop("from_speed", UNSET) + + to_speed = d.pop("to_speed", UNSET) + + time_step = d.pop("time_step", UNSET) + + no_of_points = d.pop("no_of_points", UNSET) + + base_speed_ratio = d.pop("base_speed_ratio", UNSET) + + required_time = d.pop("required_time", UNSET) + + required_distance = d.pop("required_distance", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + max_capability = d.pop("max_capability", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + requirement_input_type = cast( + Literal["dynamic"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "dynamic" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'dynamic', got '{requirement_input_type}'" + ) + + dynamic_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + from_speed=from_speed, + to_speed=to_speed, + time_step=time_step, + no_of_points=no_of_points, + base_speed_ratio=base_speed_ratio, + required_time=required_time, + required_distance=required_distance, + altitude=altitude, + headwind=headwind, + gradient=gradient, + max_capability=max_capability, + front_axle_split=front_axle_split, + requirement_input_type=requirement_input_type, + ) + + dynamic_requirement_input.additional_properties = d + return dynamic_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/dynamic_requirement_output.py b/src/ansys/conceptev/core/generated/models/dynamic_requirement_output.py new file mode 100644 index 00000000..201ead38 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/dynamic_requirement_output.py @@ -0,0 +1,380 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="DynamicRequirementOutput") + + +@_attrs_define +class DynamicRequirementOutput: + """Dynamic Requirement Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "D1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + thermal_analysis: bool | Unset = False + shift_delta: float | Unset = 0.0 + stop_at_temperature_limit: bool | Unset = True + from_speed: float | Unset = 0.0 + to_speed: float | Unset = 1.0 + time_step: float | Unset = 0.1 + no_of_points: int | Unset = 6 + base_speed_ratio: float | Unset = 0.5 + required_time: float | Unset = 10000000000.0 + required_distance: float | Unset = 10000000000.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + max_capability: bool | Unset = False + front_axle_split: float | None | Unset = UNSET + requirement_input_type: Literal["dynamic"] | Unset = "dynamic" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + thermal_analysis = self.thermal_analysis + + shift_delta = self.shift_delta + + stop_at_temperature_limit = self.stop_at_temperature_limit + + from_speed = self.from_speed + + to_speed = self.to_speed + + time_step = self.time_step + + no_of_points = self.no_of_points + + base_speed_ratio = self.base_speed_ratio + + required_time = self.required_time + + required_distance = self.required_distance + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + max_capability = self.max_capability + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if thermal_analysis is not UNSET: + field_dict["thermal_analysis"] = thermal_analysis + if shift_delta is not UNSET: + field_dict["shift_delta"] = shift_delta + if stop_at_temperature_limit is not UNSET: + field_dict["stop_at_temperature_limit"] = stop_at_temperature_limit + if from_speed is not UNSET: + field_dict["from_speed"] = from_speed + if to_speed is not UNSET: + field_dict["to_speed"] = to_speed + if time_step is not UNSET: + field_dict["time_step"] = time_step + if no_of_points is not UNSET: + field_dict["no_of_points"] = no_of_points + if base_speed_ratio is not UNSET: + field_dict["base_speed_ratio"] = base_speed_ratio + if required_time is not UNSET: + field_dict["required_time"] = required_time + if required_distance is not UNSET: + field_dict["required_distance"] = required_distance + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if max_capability is not UNSET: + field_dict["max_capability"] = max_capability + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + thermal_analysis = d.pop("thermal_analysis", UNSET) + + shift_delta = d.pop("shift_delta", UNSET) + + stop_at_temperature_limit = d.pop("stop_at_temperature_limit", UNSET) + + from_speed = d.pop("from_speed", UNSET) + + to_speed = d.pop("to_speed", UNSET) + + time_step = d.pop("time_step", UNSET) + + no_of_points = d.pop("no_of_points", UNSET) + + base_speed_ratio = d.pop("base_speed_ratio", UNSET) + + required_time = d.pop("required_time", UNSET) + + required_distance = d.pop("required_distance", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + max_capability = d.pop("max_capability", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + requirement_input_type = cast( + Literal["dynamic"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "dynamic" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'dynamic', got '{requirement_input_type}'" + ) + + dynamic_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + thermal_analysis=thermal_analysis, + shift_delta=shift_delta, + stop_at_temperature_limit=stop_at_temperature_limit, + from_speed=from_speed, + to_speed=to_speed, + time_step=time_step, + no_of_points=no_of_points, + base_speed_ratio=base_speed_ratio, + required_time=required_time, + required_distance=required_distance, + altitude=altitude, + headwind=headwind, + gradient=gradient, + max_capability=max_capability, + front_axle_split=front_axle_split, + requirement_input_type=requirement_input_type, + ) + + dynamic_requirement_output.additional_properties = d + return dynamic_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/edge.py b/src/ansys/conceptev/core/generated/models/edge.py new file mode 100644 index 00000000..0eb1b1d3 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/edge.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Edge") + + +@_attrs_define +class Edge: + resistance: float + connected_node_list: list[Any] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + resistance = self.resistance + + connected_node_list: list[Any] | Unset = UNSET + if not isinstance(self.connected_node_list, Unset): + connected_node_list = self.connected_node_list + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "resistance": resistance, + } + ) + if connected_node_list is not UNSET: + field_dict["connected_node_list"] = connected_node_list + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + resistance = d.pop("resistance") + + connected_node_list = cast(list[Any], d.pop("connected_node_list", UNSET)) + + edge = cls( + resistance=resistance, + connected_node_list=connected_node_list, + ) + + edge.additional_properties = d + return edge + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/electric_charge_unit.py b/src/ansys/conceptev/core/generated/models/electric_charge_unit.py new file mode 100644 index 00000000..8f92de22 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/electric_charge_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +ElectricChargeUnit = Literal["A·s"] + +ELECTRIC_CHARGE_UNIT_VALUES: set[ElectricChargeUnit] = { + "A·s", +} + + +def check_electric_charge_unit(value: str) -> ElectricChargeUnit: + if value in ELECTRIC_CHARGE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ELECTRIC_CHARGE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/electrical_energy_unit.py b/src/ansys/conceptev/core/generated/models/electrical_energy_unit.py new file mode 100644 index 00000000..dfe83b44 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/electrical_energy_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +ElectricalEnergyUnit = Literal["J", "kWh", "VA·hr", "Wh"] + +ELECTRICAL_ENERGY_UNIT_VALUES: set[ElectricalEnergyUnit] = { + "J", + "kWh", + "VA·hr", + "Wh", +} + + +def check_electrical_energy_unit(value: str) -> ElectricalEnergyUnit: + if value in ELECTRICAL_ENERGY_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ELECTRICAL_ENERGY_UNIT_VALUES!r}" + ) diff --git a/src/ansys/conceptev/core/generated/models/electrical_power_unit.py b/src/ansys/conceptev/core/generated/models/electrical_power_unit.py new file mode 100644 index 00000000..72df1259 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/electrical_power_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +ElectricalPowerUnit = Literal["kVA", "kW", "VA", "W"] + +ELECTRICAL_POWER_UNIT_VALUES: set[ElectricalPowerUnit] = { + "kVA", + "kW", + "VA", + "W", +} + + +def check_electrical_power_unit(value: str) -> ElectricalPowerUnit: + if value in ELECTRICAL_POWER_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ELECTRICAL_POWER_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/energy_unit.py b/src/ansys/conceptev/core/generated/models/energy_unit.py new file mode 100644 index 00000000..0ed0cf1b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/energy_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +EnergyUnit = Literal["J", "kJ", "kWh", "mJ", "MJ", "Wh"] + +ENERGY_UNIT_VALUES: set[EnergyUnit] = { + "J", + "kJ", + "kWh", + "mJ", + "MJ", + "Wh", +} + + +def check_energy_unit(value: str) -> EnergyUnit: + if value in ENERGY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ENERGY_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/file_info.py b/src/ansys/conceptev/core/generated/models/file_info.py new file mode 100644 index 00000000..b8efe544 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/file_info.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileInfo") + + +@_attrs_define +class FileInfo: + """File data model.""" + + id: str + path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + path = self.path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "path": path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + path = d.pop("path") + + file_info = cls( + id=id, + path=path, + ) + + file_info.additional_properties = d + return file_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/file_item_create_response.py b/src/ansys/conceptev/core/generated/models/file_item_create_response.py new file mode 100644 index 00000000..c784227f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/file_item_create_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.file_item_create_response_calculated_values import ( + FileItemCreateResponseCalculatedValues, + ) + + +T = TypeVar("T", bound="FileItemCreateResponse") + + +@_attrs_define +class FileItemCreateResponse: + """Response from creating a file item. + + Includes any calculated values extracted from the file. + + """ + + name: str + id: str | Unset = UNSET + calculated_values: FileItemCreateResponseCalculatedValues | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + calculated_values: dict[str, Any] | Unset = UNSET + if not isinstance(self.calculated_values, Unset): + calculated_values = self.calculated_values.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if id is not UNSET: + field_dict["id"] = id + if calculated_values is not UNSET: + field_dict["calculated_values"] = calculated_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.file_item_create_response_calculated_values import ( + FileItemCreateResponseCalculatedValues, + ) + + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id", UNSET) + + _calculated_values = d.pop("calculated_values", UNSET) + calculated_values: FileItemCreateResponseCalculatedValues | Unset + if isinstance(_calculated_values, Unset): + calculated_values = UNSET + else: + calculated_values = FileItemCreateResponseCalculatedValues.from_dict(_calculated_values) + + file_item_create_response = cls( + name=name, + id=id, + calculated_values=calculated_values, + ) + + file_item_create_response.additional_properties = d + return file_item_create_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/file_item_create_response_calculated_values.py b/src/ansys/conceptev/core/generated/models/file_item_create_response_calculated_values.py new file mode 100644 index 00000000..5270553a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/file_item_create_response_calculated_values.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileItemCreateResponseCalculatedValues") + + +@_attrs_define +class FileItemCreateResponseCalculatedValues: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + file_item_create_response_calculated_values = cls() + + file_item_create_response_calculated_values.additional_properties = d + return file_item_create_response_calculated_values + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/file_item_input.py b/src/ansys/conceptev/core/generated/models/file_item_input.py new file mode 100644 index 00000000..27975f5d --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/file_item_input.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileItemInput") + + +@_attrs_define +class FileItemInput: + """File Item Input — metadata supplied when registering a stored file.""" + + name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + file_item_input = cls( + name=name, + ) + + file_item_input.additional_properties = d + return file_item_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/file_item_output.py b/src/ansys/conceptev/core/generated/models/file_item_output.py new file mode 100644 index 00000000..6125673b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/file_item_output.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FileItemOutput") + + +@_attrs_define +class FileItemOutput: + """File Item.""" + + name: str + id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id", UNSET) + + file_item_output = cls( + name=name, + id=id, + ) + + file_item_output.additional_properties = d + return file_item_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/force_unit.py b/src/ansys/conceptev/core/generated/models/force_unit.py new file mode 100644 index 00000000..b02971fb --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/force_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +ForceUnit = Literal["dyn", "lbf", "N"] + +FORCE_UNIT_VALUES: set[ForceUnit] = { + "dyn", + "lbf", + "N", +} + + +def check_force_unit(value: str) -> ForceUnit: + if value in FORCE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FORCE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/frequency_unit.py b/src/ansys/conceptev/core/generated/models/frequency_unit.py new file mode 100644 index 00000000..495ca5fc --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/frequency_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +FrequencyUnit = Literal["Hz"] + +FREQUENCY_UNIT_VALUES: set[FrequencyUnit] = { + "Hz", +} + + +def check_frequency_unit(value: str) -> FrequencyUnit: + if value in FREQUENCY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FREQUENCY_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py b/src/ansys/conceptev/core/generated/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py new file mode 100644 index 00000000..c947b155 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet") + + +@_attrs_define +class GetInfoUnitChoicesInfoGetResponseGetInfoUnitChoicesInfoGet: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_info_unit_choices_info_get_response_get_info_unit_choices_info_get = cls() + + get_info_unit_choices_info_get_response_get_info_unit_choices_info_get.additional_properties = ( + d + ) + return get_info_unit_choices_info_get_response_get_info_unit_choices_info_get + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/http_validation_error.py b/src/ansys/conceptev/core/generated/models/http_validation_error.py new file mode 100644 index 00000000..f08fcaca --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/http_validation_error.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error import ValidationError + + +T = TypeVar("T", bound="HTTPValidationError") + + +@_attrs_define +class HTTPValidationError: + detail: list[ValidationError] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + detail: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.detail, Unset): + detail = [] + for detail_item_data in self.detail: + detail_item = detail_item_data.to_dict() + detail.append(detail_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if detail is not UNSET: + field_dict["detail"] = detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error import ValidationError + + d = dict(src_dict) + _detail = d.pop("detail", UNSET) + detail: list[ValidationError] | Unset = UNSET + if _detail is not UNSET: + detail = [] + for detail_item_data in _detail: + detail_item = ValidationError.from_dict(detail_item_data) + + detail.append(detail_item) + + http_validation_error = cls( + detail=detail, + ) + + http_validation_error.additional_properties = d + return http_validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/inertia_unit.py b/src/ansys/conceptev/core/generated/models/inertia_unit.py new file mode 100644 index 00000000..fd77043f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/inertia_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +InertiaUnit = Literal["g·mm²", "kg·m²"] + +INERTIA_UNIT_VALUES: set[InertiaUnit] = { + "g·mm²", + "kg·m²", +} + + +def check_inertia_unit(value: str) -> InertiaUnit: + if value in INERTIA_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {INERTIA_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/job_output.py b/src/ansys/conceptev/core/generated/models/job_output.py new file mode 100644 index 00000000..d0b22e54 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/job_output.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.file_info import FileInfo + + +T = TypeVar("T", bound="JobOutput") + + +@_attrs_define +class JobOutput: + """Job result data model.""" + + name: str + id: str + status: str + files: list[FileInfo] | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + id = self.id + + status = self.status + + files: list[dict[str, Any]] | None | Unset + if isinstance(self.files, Unset): + files = UNSET + elif isinstance(self.files, list): + files = [] + for files_type_0_item_data in self.files: + files_type_0_item = files_type_0_item_data.to_dict() + files.append(files_type_0_item) + + else: + files = self.files + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "id": id, + "status": status, + } + ) + if files is not UNSET: + field_dict["files"] = files + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.file_info import FileInfo + + d = dict(src_dict) + name = d.pop("name") + + id = d.pop("id") + + status = d.pop("status") + + def _parse_files(data: object) -> list[FileInfo] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + files_type_0 = [] + _files_type_0 = data + for files_type_0_item_data in _files_type_0: + files_type_0_item = FileInfo.from_dict(files_type_0_item_data) + + files_type_0.append(files_type_0_item) + + return files_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[FileInfo] | None | Unset, data) + + files = _parse_files(d.pop("files", UNSET)) + + job_output = cls( + name=name, + id=id, + status=status, + files=files, + ) + + job_output.additional_properties = d + return job_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/job_request.py b/src/ansys/conceptev/core/generated/models/job_request.py new file mode 100644 index 00000000..3f307fbe --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/job_request.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="JobRequest") + + +@_attrs_define +class JobRequest: + """Request body for creating a job.""" + + name: str + requirement_ids: list[str] + architecture_id: str + account_id: str | Unset = UNSET + design_instance_id: str | Unset = UNSET + version: str | Unset = "latest" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + requirement_ids = self.requirement_ids + + architecture_id = self.architecture_id + + account_id = self.account_id + + design_instance_id = self.design_instance_id + + version = self.version + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "requirement_ids": requirement_ids, + "architecture_id": architecture_id, + } + ) + if account_id is not UNSET: + field_dict["account_id"] = account_id + if design_instance_id is not UNSET: + field_dict["design_instance_id"] = design_instance_id + if version is not UNSET: + field_dict["version"] = version + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + requirement_ids = cast(list[str], d.pop("requirement_ids")) + + architecture_id = d.pop("architecture_id") + + account_id = d.pop("account_id", UNSET) + + design_instance_id = d.pop("design_instance_id", UNSET) + + version = d.pop("version", UNSET) + + job_request = cls( + name=name, + requirement_ids=requirement_ids, + architecture_id=architecture_id, + account_id=account_id, + design_instance_id=design_instance_id, + version=version, + ) + + job_request.additional_properties = d + return job_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/length_unit.py b/src/ansys/conceptev/core/generated/models/length_unit.py new file mode 100644 index 00000000..bd04e797 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/length_unit.py @@ -0,0 +1,20 @@ +from typing import Literal + +LengthUnit = Literal["cm", "ft", "in", "km", "m", "miles", "mm", "yd"] + +LENGTH_UNIT_VALUES: set[LengthUnit] = { + "cm", + "ft", + "in", + "km", + "m", + "miles", + "mm", + "yd", +} + + +def check_length_unit(value: str) -> LengthUnit: + if value in LENGTH_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LENGTH_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/loss_map_grid_lab.py b/src/ansys/conceptev/core/generated/models/loss_map_grid_lab.py new file mode 100644 index 00000000..bbfe0b64 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/loss_map_grid_lab.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LossMapGridLab") + + +@_attrs_define +class LossMapGridLab: + """Used for Lab motors if no efficiency map included in the .lab file. + + Losses for plotted with current/phase advance or current/slip. + + """ + + currents: list[float] + phase_advances: list[float] | None + slips: list[float] | None + losses_total: list[list[float]] + losses_iron: list[list[float]] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + currents = self.currents + + phase_advances: list[float] | None + if isinstance(self.phase_advances, list): + phase_advances = self.phase_advances + + else: + phase_advances = self.phase_advances + + slips: list[float] | None + if isinstance(self.slips, list): + slips = self.slips + + else: + slips = self.slips + + losses_total = [] + for losses_total_item_data in self.losses_total: + losses_total_item = losses_total_item_data + + losses_total.append(losses_total_item) + + losses_iron = [] + for losses_iron_item_data in self.losses_iron: + losses_iron_item = losses_iron_item_data + + losses_iron.append(losses_iron_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "currents": currents, + "phase_advances": phase_advances, + "slips": slips, + "losses_total": losses_total, + "losses_iron": losses_iron, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + currents = cast(list[float], d.pop("currents")) + + def _parse_phase_advances(data: object) -> list[float] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + phase_advances_type_0 = cast(list[float], data) + + return phase_advances_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[float] | None, data) + + phase_advances = _parse_phase_advances(d.pop("phase_advances")) + + def _parse_slips(data: object) -> list[float] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + slips_type_0 = cast(list[float], data) + + return slips_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[float] | None, data) + + slips = _parse_slips(d.pop("slips")) + + losses_total = [] + _losses_total = d.pop("losses_total") + for losses_total_item_data in _losses_total: + losses_total_item = cast(list[float], losses_total_item_data) + + losses_total.append(losses_total_item) + + losses_iron = [] + _losses_iron = d.pop("losses_iron") + for losses_iron_item_data in _losses_iron: + losses_iron_item = cast(list[float], losses_iron_item_data) + + losses_iron.append(losses_iron_item) + + loss_map_grid_lab = cls( + currents=currents, + phase_advances=phase_advances, + slips=slips, + losses_total=losses_total, + losses_iron=losses_iron, + ) + + loss_map_grid_lab.additional_properties = d + return loss_map_grid_lab + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/loss_map_grid_power.py b/src/ansys/conceptev/core/generated/models/loss_map_grid_power.py new file mode 100644 index 00000000..1be5da64 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/loss_map_grid_power.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + +T = TypeVar("T", bound="LossMapGridPower") + + +@_attrs_define +class LossMapGridPower: + """Power losses (e.g. motors).""" + + speeds: list[float] + torques: list[float] + losses: list[list[float]] + efficiencies: list[list[float]] + powers: list[list[float]] + meta_data: LossMapGridPowerMetaData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + speeds = self.speeds + + torques = self.torques + + losses = [] + for losses_item_data in self.losses: + losses_item = losses_item_data + + losses.append(losses_item) + + efficiencies = [] + for efficiencies_item_data in self.efficiencies: + efficiencies_item = efficiencies_item_data + + efficiencies.append(efficiencies_item) + + powers = [] + for powers_item_data in self.powers: + powers_item = powers_item_data + + powers.append(powers_item) + + meta_data: dict[str, Any] | None | Unset + if isinstance(self.meta_data, Unset): + meta_data = UNSET + elif isinstance(self.meta_data, LossMapGridPowerMetaData): + meta_data = self.meta_data.to_dict() + else: + meta_data = self.meta_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "speeds": speeds, + "torques": torques, + "losses": losses, + "efficiencies": efficiencies, + "powers": powers, + } + ) + if meta_data is not UNSET: + field_dict["meta_data"] = meta_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.loss_map_grid_power_meta_data import LossMapGridPowerMetaData + + d = dict(src_dict) + speeds = cast(list[float], d.pop("speeds")) + + torques = cast(list[float], d.pop("torques")) + + losses = [] + _losses = d.pop("losses") + for losses_item_data in _losses: + losses_item = cast(list[float], losses_item_data) + + losses.append(losses_item) + + efficiencies = [] + _efficiencies = d.pop("efficiencies") + for efficiencies_item_data in _efficiencies: + efficiencies_item = cast(list[float], efficiencies_item_data) + + efficiencies.append(efficiencies_item) + + powers = [] + _powers = d.pop("powers") + for powers_item_data in _powers: + powers_item = cast(list[float], powers_item_data) + + powers.append(powers_item) + + def _parse_meta_data(data: object) -> LossMapGridPowerMetaData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + meta_data_type_0 = LossMapGridPowerMetaData.from_dict(data) + + return meta_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LossMapGridPowerMetaData | None | Unset, data) + + meta_data = _parse_meta_data(d.pop("meta_data", UNSET)) + + loss_map_grid_power = cls( + speeds=speeds, + torques=torques, + losses=losses, + efficiencies=efficiencies, + powers=powers, + meta_data=meta_data, + ) + + loss_map_grid_power.additional_properties = d + return loss_map_grid_power + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/loss_map_grid_power_meta_data.py b/src/ansys/conceptev/core/generated/models/loss_map_grid_power_meta_data.py new file mode 100644 index 00000000..9dc2f59b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/loss_map_grid_power_meta_data.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LossMapGridPowerMetaData") + + +@_attrs_define +class LossMapGridPowerMetaData: + """Meta-data for efficiency maps that have been calculated in Lab.""" + + voltage: float + control_strategy_bpm: int | None + control_strategy_sync: int | None + current_limit_line_peak: float + stator_temperature: float + rotor_temperature: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + voltage = self.voltage + + control_strategy_bpm: int | None + control_strategy_bpm = self.control_strategy_bpm + + control_strategy_sync: int | None + control_strategy_sync = self.control_strategy_sync + + current_limit_line_peak = self.current_limit_line_peak + + stator_temperature = self.stator_temperature + + rotor_temperature = self.rotor_temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "voltage": voltage, + "control_strategy_bpm": control_strategy_bpm, + "control_strategy_sync": control_strategy_sync, + "current_limit_line_peak": current_limit_line_peak, + "stator_temperature": stator_temperature, + "rotor_temperature": rotor_temperature, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + voltage = d.pop("voltage") + + def _parse_control_strategy_bpm(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + control_strategy_bpm = _parse_control_strategy_bpm(d.pop("control_strategy_bpm")) + + def _parse_control_strategy_sync(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + control_strategy_sync = _parse_control_strategy_sync(d.pop("control_strategy_sync")) + + current_limit_line_peak = d.pop("current_limit_line_peak") + + stator_temperature = d.pop("stator_temperature") + + rotor_temperature = d.pop("rotor_temperature") + + loss_map_grid_power_meta_data = cls( + voltage=voltage, + control_strategy_bpm=control_strategy_bpm, + control_strategy_sync=control_strategy_sync, + current_limit_line_peak=current_limit_line_peak, + stator_temperature=stator_temperature, + rotor_temperature=rotor_temperature, + ) + + loss_map_grid_power_meta_data.additional_properties = d + return loss_map_grid_power_meta_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/mass.py b/src/ansys/conceptev/core/generated/models/mass.py new file mode 100644 index 00000000..a72c3812 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/mass.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Mass") + + +@_attrs_define +class Mass: + """Mass Configuration.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + mass = cls( + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + ) + + mass.additional_properties = d + return mass + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/mass_input.py b/src/ansys/conceptev/core/generated/models/mass_input.py new file mode 100644 index 00000000..433e09d2 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/mass_input.py @@ -0,0 +1,142 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MassInput") + + +@_attrs_define +class MassInput: + """Mass Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + mass_input = cls( + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + part_type=part_type, + ) + + mass_input.additional_properties = d + return mass_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/mass_output.py b/src/ansys/conceptev/core/generated/models/mass_output.py new file mode 100644 index 00000000..126685f6 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/mass_output.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MassOutput") + + +@_attrs_define +class MassOutput: + """Mass Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Default Mass Config" + mass: float | Unset = 2000.0 + com_horizontal_offset: float | None | Unset = UNSET + com_vertical_height: float | None | Unset = UNSET + add_components_mass: bool | Unset = False + config_type: Literal["mass"] | Unset = "mass" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + com_horizontal_offset: float | None | Unset + if isinstance(self.com_horizontal_offset, Unset): + com_horizontal_offset = UNSET + else: + com_horizontal_offset = self.com_horizontal_offset + + com_vertical_height: float | None | Unset + if isinstance(self.com_vertical_height, Unset): + com_vertical_height = UNSET + else: + com_vertical_height = self.com_vertical_height + + add_components_mass = self.add_components_mass + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if com_horizontal_offset is not UNSET: + field_dict["com_horizontal_offset"] = com_horizontal_offset + if com_vertical_height is not UNSET: + field_dict["com_vertical_height"] = com_vertical_height + if add_components_mass is not UNSET: + field_dict["add_components_mass"] = add_components_mass + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + def _parse_com_horizontal_offset(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_horizontal_offset = _parse_com_horizontal_offset(d.pop("com_horizontal_offset", UNSET)) + + def _parse_com_vertical_height(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + com_vertical_height = _parse_com_vertical_height(d.pop("com_vertical_height", UNSET)) + + add_components_mass = d.pop("add_components_mass", UNSET) + + config_type = cast(Literal["mass"] | Unset, d.pop("config_type", UNSET)) + if config_type != "mass" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'mass', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + mass_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + com_horizontal_offset=com_horizontal_offset, + com_vertical_height=com_vertical_height, + add_components_mass=add_components_mass, + config_type=config_type, + part_type=part_type, + ) + + mass_output.additional_properties = d + return mass_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/mass_unit.py b/src/ansys/conceptev/core/generated/models/mass_unit.py new file mode 100644 index 00000000..ae9f8c4b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/mass_unit.py @@ -0,0 +1,19 @@ +from typing import Literal + +MassUnit = Literal["g", "kg", "lb", "LT", "oz", "t", "tn"] + +MASS_UNIT_VALUES: set[MassUnit] = { + "g", + "kg", + "lb", + "LT", + "oz", + "t", + "tn", +} + + +def check_mass_unit(value: str) -> MassUnit: + if value in MASS_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {MASS_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/motor_configuration.py b/src/ansys/conceptev/core/generated/models/motor_configuration.py new file mode 100644 index 00000000..450d0066 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_configuration.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.component_axle import ComponentAxle, check_component_axle +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_state import MotorState + + +T = TypeVar("T", bound="MotorConfiguration") + + +@_attrs_define +class MotorConfiguration: + """Configuration that can change characteristics of the motor.""" + + component_config_type: Literal["motor"] | Unset = "motor" + axle: ComponentAxle | Unset = UNSET + """ Component axle. """ + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_config_type = self.component_config_type + + axle: str | Unset = UNSET + if not isinstance(self.axle, Unset): + axle = self.axle + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if component_config_type is not UNSET: + field_dict["component_config_type"] = component_config_type + if axle is not UNSET: + field_dict["axle"] = axle + if state is not UNSET: + field_dict["state"] = state + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_state import MotorState + + d = dict(src_dict) + component_config_type = cast( + Literal["motor"] | Unset, d.pop("component_config_type", UNSET) + ) + if component_config_type != "motor" and not isinstance(component_config_type, Unset): + raise ValueError( + f"component_config_type must match const 'motor', got '{component_config_type}'" + ) + + _axle = d.pop("axle", UNSET) + axle: ComponentAxle | Unset + if isinstance(_axle, Unset): + axle = UNSET + else: + axle = check_component_axle(_axle) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + motor_configuration = cls( + component_config_type=component_config_type, + axle=axle, + state=state, + ) + + motor_configuration.additional_properties = d + return motor_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_lab_data.py b/src/ansys/conceptev/core/generated/models/motor_lab_data.py new file mode 100644 index 00000000..5870da9b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_lab_data.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data_lab_file_dict import MotorLabDataLabFileDict + + +T = TypeVar("T", bound="MotorLabData") + + +@_attrs_define +class MotorLabData: + """Motor Lab Data. + + Model is held as a dict, exported from Lab. + + """ + + lab_file_dict: MotorLabDataLabFileDict + component_file_type: Literal["MotorLab"] | Unset = "MotorLab" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + lab_file_dict = self.lab_file_dict.to_dict() + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "lab_file_dict": lab_file_dict, + } + ) + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data_lab_file_dict import MotorLabDataLabFileDict + + d = dict(src_dict) + lab_file_dict = MotorLabDataLabFileDict.from_dict(d.pop("lab_file_dict")) + + component_file_type = cast(Literal["MotorLab"] | Unset, d.pop("component_file_type", UNSET)) + if component_file_type != "MotorLab" and not isinstance(component_file_type, Unset): + raise ValueError( + f"component_file_type must match const 'MotorLab', got '{component_file_type}'" + ) + + motor_lab_data = cls( + lab_file_dict=lab_file_dict, + component_file_type=component_file_type, + ) + + motor_lab_data.additional_properties = d + return motor_lab_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_lab_data_lab_file_dict.py b/src/ansys/conceptev/core/generated/models/motor_lab_data_lab_file_dict.py new file mode 100644 index 00000000..5ad2f0a5 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_lab_data_lab_file_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MotorLabDataLabFileDict") + + +@_attrs_define +class MotorLabDataLabFileDict: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + motor_lab_data_lab_file_dict = cls() + + motor_lab_data_lab_file_dict.additional_properties = d + return motor_lab_data_lab_file_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_lab_input.py b/src/ansys/conceptev/core/generated/models/motor_lab_input.py new file mode 100644 index 00000000..ce4d46c2 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_lab_input.py @@ -0,0 +1,246 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + +T = TypeVar("T", bound="MotorLabInput") + + +@_attrs_define +class MotorLabInput: + """Motor Lab Input.""" + + max_speed: float + lab_data_id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Component Input" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["MotorLabModel"] | Unset = "MotorLabModel" + lab_data: MotorLabData | None | Unset = UNSET + flow_rate: float | Unset = 0.0 + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + thermal_model: None | ThermalModel | Unset = UNSET + thermal_limits: MotorThermalLimits | Unset = UNSET + """ Thermal limits for motor components. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_lab_data import MotorLabData + from ..models.thermal_model import ThermalModel + + max_speed = self.max_speed + + lab_data_id = self.lab_data_id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + lab_data: dict[str, Any] | None | Unset + if isinstance(self.lab_data, Unset): + lab_data = UNSET + elif isinstance(self.lab_data, MotorLabData): + lab_data = self.lab_data.to_dict() + else: + lab_data = self.lab_data + + flow_rate = self.flow_rate + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + thermal_model: dict[str, Any] | None | Unset + if isinstance(self.thermal_model, Unset): + thermal_model = UNSET + elif isinstance(self.thermal_model, ThermalModel): + thermal_model = self.thermal_model.to_dict() + else: + thermal_model = self.thermal_model + + thermal_limits: dict[str, Any] | Unset = UNSET + if not isinstance(self.thermal_limits, Unset): + thermal_limits = self.thermal_limits.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "max_speed": max_speed, + "lab_data_id": lab_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if lab_data is not UNSET: + field_dict["lab_data"] = lab_data + if flow_rate is not UNSET: + field_dict["flow_rate"] = flow_rate + if state is not UNSET: + field_dict["state"] = state + if thermal_model is not UNSET: + field_dict["thermal_model"] = thermal_model + if thermal_limits is not UNSET: + field_dict["thermal_limits"] = thermal_limits + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + d = dict(src_dict) + max_speed = d.pop("max_speed") + + lab_data_id = d.pop("lab_data_id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["MotorLabModel"] | Unset, d.pop("component_type", UNSET)) + if component_type != "MotorLabModel" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'MotorLabModel', got '{component_type}'" + ) + + def _parse_lab_data(data: object) -> MotorLabData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + lab_data_type_0 = MotorLabData.from_dict(data) + + return lab_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MotorLabData | None | Unset, data) + + lab_data = _parse_lab_data(d.pop("lab_data", UNSET)) + + flow_rate = d.pop("flow_rate", UNSET) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + def _parse_thermal_model(data: object) -> None | ThermalModel | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + thermal_model_type_0 = ThermalModel.from_dict(data) + + return thermal_model_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ThermalModel | Unset, data) + + thermal_model = _parse_thermal_model(d.pop("thermal_model", UNSET)) + + _thermal_limits = d.pop("thermal_limits", UNSET) + thermal_limits: MotorThermalLimits | Unset + if isinstance(_thermal_limits, Unset): + thermal_limits = UNSET + else: + thermal_limits = MotorThermalLimits.from_dict(_thermal_limits) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + motor_lab_input = cls( + max_speed=max_speed, + lab_data_id=lab_data_id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + lab_data=lab_data, + flow_rate=flow_rate, + state=state, + thermal_model=thermal_model, + thermal_limits=thermal_limits, + part_type=part_type, + ) + + motor_lab_input.additional_properties = d + return motor_lab_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_lab_output.py b/src/ansys/conceptev/core/generated/models/motor_lab_output.py new file mode 100644 index 00000000..4fbc6cab --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_lab_output.py @@ -0,0 +1,253 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + +T = TypeVar("T", bound="MotorLabOutput") + + +@_attrs_define +class MotorLabOutput: + """Motor Lab Output.""" + + id: str + max_speed: float + lab_data_id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Component Input" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["MotorLabModel"] | Unset = "MotorLabModel" + lab_data: MotorLabData | None | Unset = UNSET + flow_rate: float | Unset = 0.0 + state: MotorState | Unset = UNSET + """ Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. """ + thermal_model: None | ThermalModel | Unset = UNSET + thermal_limits: MotorThermalLimits | Unset = UNSET + """ Thermal limits for motor components. """ + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.motor_lab_data import MotorLabData + from ..models.thermal_model import ThermalModel + + id = self.id + + max_speed = self.max_speed + + lab_data_id = self.lab_data_id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + lab_data: dict[str, Any] | None | Unset + if isinstance(self.lab_data, Unset): + lab_data = UNSET + elif isinstance(self.lab_data, MotorLabData): + lab_data = self.lab_data.to_dict() + else: + lab_data = self.lab_data + + flow_rate = self.flow_rate + + state: dict[str, Any] | Unset = UNSET + if not isinstance(self.state, Unset): + state = self.state.to_dict() + + thermal_model: dict[str, Any] | None | Unset + if isinstance(self.thermal_model, Unset): + thermal_model = UNSET + elif isinstance(self.thermal_model, ThermalModel): + thermal_model = self.thermal_model.to_dict() + else: + thermal_model = self.thermal_model + + thermal_limits: dict[str, Any] | Unset = UNSET + if not isinstance(self.thermal_limits, Unset): + thermal_limits = self.thermal_limits.to_dict() + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "max_speed": max_speed, + "lab_data_id": lab_data_id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if lab_data is not UNSET: + field_dict["lab_data"] = lab_data + if flow_rate is not UNSET: + field_dict["flow_rate"] = flow_rate + if state is not UNSET: + field_dict["state"] = state + if thermal_model is not UNSET: + field_dict["thermal_model"] = thermal_model + if thermal_limits is not UNSET: + field_dict["thermal_limits"] = thermal_limits + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.motor_lab_data import MotorLabData + from ..models.motor_state import MotorState + from ..models.motor_thermal_limits import MotorThermalLimits + from ..models.thermal_model import ThermalModel + + d = dict(src_dict) + id = d.pop("id") + + max_speed = d.pop("max_speed") + + lab_data_id = d.pop("lab_data_id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast(Literal["MotorLabModel"] | Unset, d.pop("component_type", UNSET)) + if component_type != "MotorLabModel" and not isinstance(component_type, Unset): + raise ValueError( + f"component_type must match const 'MotorLabModel', got '{component_type}'" + ) + + def _parse_lab_data(data: object) -> MotorLabData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + lab_data_type_0 = MotorLabData.from_dict(data) + + return lab_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MotorLabData | None | Unset, data) + + lab_data = _parse_lab_data(d.pop("lab_data", UNSET)) + + flow_rate = d.pop("flow_rate", UNSET) + + _state = d.pop("state", UNSET) + state: MotorState | Unset + if isinstance(_state, Unset): + state = UNSET + else: + state = MotorState.from_dict(_state) + + def _parse_thermal_model(data: object) -> None | ThermalModel | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + thermal_model_type_0 = ThermalModel.from_dict(data) + + return thermal_model_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ThermalModel | Unset, data) + + thermal_model = _parse_thermal_model(d.pop("thermal_model", UNSET)) + + _thermal_limits = d.pop("thermal_limits", UNSET) + thermal_limits: MotorThermalLimits | Unset + if isinstance(_thermal_limits, Unset): + thermal_limits = UNSET + else: + thermal_limits = MotorThermalLimits.from_dict(_thermal_limits) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + motor_lab_output = cls( + id=id, + max_speed=max_speed, + lab_data_id=lab_data_id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + lab_data=lab_data, + flow_rate=flow_rate, + state=state, + thermal_model=thermal_model, + thermal_limits=thermal_limits, + part_type=part_type, + ) + + motor_lab_output.additional_properties = d + return motor_lab_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_state.py b/src/ansys/conceptev/core/generated/models/motor_state.py new file mode 100644 index 00000000..63efe140 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_state.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MotorState") + + +@_attrs_define +class MotorState: + """Variables that define state of a motor. + + Essentially these are mostly all inputs to a Lab operating point calculation. + + """ + + stator_winding_temp: float | None | Unset = UNSET + stator_winding_temp_peak: float | None | Unset = UNSET + rotor_temp: float | None | Unset = UNSET + stator_current_limit: float | None | Unset = UNSET + airgap_temp: float | None | Unset = UNSET + bearing_temp_front: float | None | Unset = UNSET + bearing_temp_rear: float | None | Unset = UNSET + control_strategy_bpm: int | None | Unset = UNSET + control_strategy_sync: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + stator_winding_temp: float | None | Unset + if isinstance(self.stator_winding_temp, Unset): + stator_winding_temp = UNSET + else: + stator_winding_temp = self.stator_winding_temp + + stator_winding_temp_peak: float | None | Unset + if isinstance(self.stator_winding_temp_peak, Unset): + stator_winding_temp_peak = UNSET + else: + stator_winding_temp_peak = self.stator_winding_temp_peak + + rotor_temp: float | None | Unset + if isinstance(self.rotor_temp, Unset): + rotor_temp = UNSET + else: + rotor_temp = self.rotor_temp + + stator_current_limit: float | None | Unset + if isinstance(self.stator_current_limit, Unset): + stator_current_limit = UNSET + else: + stator_current_limit = self.stator_current_limit + + airgap_temp: float | None | Unset + if isinstance(self.airgap_temp, Unset): + airgap_temp = UNSET + else: + airgap_temp = self.airgap_temp + + bearing_temp_front: float | None | Unset + if isinstance(self.bearing_temp_front, Unset): + bearing_temp_front = UNSET + else: + bearing_temp_front = self.bearing_temp_front + + bearing_temp_rear: float | None | Unset + if isinstance(self.bearing_temp_rear, Unset): + bearing_temp_rear = UNSET + else: + bearing_temp_rear = self.bearing_temp_rear + + control_strategy_bpm: int | None | Unset + if isinstance(self.control_strategy_bpm, Unset): + control_strategy_bpm = UNSET + else: + control_strategy_bpm = self.control_strategy_bpm + + control_strategy_sync: int | None | Unset + if isinstance(self.control_strategy_sync, Unset): + control_strategy_sync = UNSET + else: + control_strategy_sync = self.control_strategy_sync + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if stator_winding_temp is not UNSET: + field_dict["stator_winding_temp"] = stator_winding_temp + if stator_winding_temp_peak is not UNSET: + field_dict["stator_winding_temp_peak"] = stator_winding_temp_peak + if rotor_temp is not UNSET: + field_dict["rotor_temp"] = rotor_temp + if stator_current_limit is not UNSET: + field_dict["stator_current_limit"] = stator_current_limit + if airgap_temp is not UNSET: + field_dict["airgap_temp"] = airgap_temp + if bearing_temp_front is not UNSET: + field_dict["bearing_temp_front"] = bearing_temp_front + if bearing_temp_rear is not UNSET: + field_dict["bearing_temp_rear"] = bearing_temp_rear + if control_strategy_bpm is not UNSET: + field_dict["control_strategy_bpm"] = control_strategy_bpm + if control_strategy_sync is not UNSET: + field_dict["control_strategy_sync"] = control_strategy_sync + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_stator_winding_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_winding_temp = _parse_stator_winding_temp(d.pop("stator_winding_temp", UNSET)) + + def _parse_stator_winding_temp_peak(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_winding_temp_peak = _parse_stator_winding_temp_peak( + d.pop("stator_winding_temp_peak", UNSET) + ) + + def _parse_rotor_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + rotor_temp = _parse_rotor_temp(d.pop("rotor_temp", UNSET)) + + def _parse_stator_current_limit(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator_current_limit = _parse_stator_current_limit(d.pop("stator_current_limit", UNSET)) + + def _parse_airgap_temp(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + airgap_temp = _parse_airgap_temp(d.pop("airgap_temp", UNSET)) + + def _parse_bearing_temp_front(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + bearing_temp_front = _parse_bearing_temp_front(d.pop("bearing_temp_front", UNSET)) + + def _parse_bearing_temp_rear(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + bearing_temp_rear = _parse_bearing_temp_rear(d.pop("bearing_temp_rear", UNSET)) + + def _parse_control_strategy_bpm(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + control_strategy_bpm = _parse_control_strategy_bpm(d.pop("control_strategy_bpm", UNSET)) + + def _parse_control_strategy_sync(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + control_strategy_sync = _parse_control_strategy_sync(d.pop("control_strategy_sync", UNSET)) + + motor_state = cls( + stator_winding_temp=stator_winding_temp, + stator_winding_temp_peak=stator_winding_temp_peak, + rotor_temp=rotor_temp, + stator_current_limit=stator_current_limit, + airgap_temp=airgap_temp, + bearing_temp_front=bearing_temp_front, + bearing_temp_rear=bearing_temp_rear, + control_strategy_bpm=control_strategy_bpm, + control_strategy_sync=control_strategy_sync, + ) + + motor_state.additional_properties = d + return motor_state + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/motor_thermal_limits.py b/src/ansys/conceptev/core/generated/models/motor_thermal_limits.py new file mode 100644 index 00000000..6d03bfee --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/motor_thermal_limits.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MotorThermalLimits") + + +@_attrs_define +class MotorThermalLimits: + """Thermal limits for motor components.""" + + stator: float | None | Unset = UNSET + rotor: float | None | Unset = UNSET + stator_limit_type: str | Unset = "average" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + stator: float | None | Unset + if isinstance(self.stator, Unset): + stator = UNSET + else: + stator = self.stator + + rotor: float | None | Unset + if isinstance(self.rotor, Unset): + rotor = UNSET + else: + rotor = self.rotor + + stator_limit_type = self.stator_limit_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if stator is not UNSET: + field_dict["stator"] = stator + if rotor is not UNSET: + field_dict["rotor"] = rotor + if stator_limit_type is not UNSET: + field_dict["stator_limit_type"] = stator_limit_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_stator(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + stator = _parse_stator(d.pop("stator", UNSET)) + + def _parse_rotor(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + rotor = _parse_rotor(d.pop("rotor", UNSET)) + + stator_limit_type = d.pop("stator_limit_type", UNSET) + + motor_thermal_limits = cls( + stator=stator, + rotor=rotor, + stator_limit_type=stator_limit_type, + ) + + motor_thermal_limits.additional_properties = d + return motor_thermal_limits + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/node.py b/src/ansys/conceptev/core/generated/models/node.py new file mode 100644 index 00000000..6d2d4be3 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/node.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Node") + + +@_attrs_define +class Node: + uid: int + name: str + capacitance: float | Unset = 0.0 + fixed_temperature: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uid = self.uid + + name = self.name + + capacitance = self.capacitance + + fixed_temperature: float | None | Unset + if isinstance(self.fixed_temperature, Unset): + fixed_temperature = UNSET + else: + fixed_temperature = self.fixed_temperature + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "uid": uid, + "name": name, + } + ) + if capacitance is not UNSET: + field_dict["capacitance"] = capacitance + if fixed_temperature is not UNSET: + field_dict["fixed_temperature"] = fixed_temperature + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + uid = d.pop("uid") + + name = d.pop("name") + + capacitance = d.pop("capacitance", UNSET) + + def _parse_fixed_temperature(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + fixed_temperature = _parse_fixed_temperature(d.pop("fixed_temperature", UNSET)) + + node = cls( + uid=uid, + name=name, + capacitance=capacitance, + fixed_temperature=fixed_temperature, + ) + + node.additional_properties = d + return node + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/part_type.py b/src/ansys/conceptev/core/generated/models/part_type.py new file mode 100644 index 00000000..3cea238f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/part_type.py @@ -0,0 +1,20 @@ +from typing import Literal + +PartType = Literal[ + "architecture", "component", "configuration", "drive_cycle", "job", "requirement" +] + +PART_TYPE_VALUES: set[PartType] = { + "architecture", + "component", + "configuration", + "drive_cycle", + "job", + "requirement", +} + + +def check_part_type(value: str) -> PartType: + if value in PART_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PART_TYPE_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/power_unit.py b/src/ansys/conceptev/core/generated/models/power_unit.py new file mode 100644 index 00000000..1b6cbf14 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/power_unit.py @@ -0,0 +1,17 @@ +from typing import Literal + +PowerUnit = Literal["hp", "kW", "mW", "MW", "W"] + +POWER_UNIT_VALUES: set[PowerUnit] = { + "hp", + "kW", + "mW", + "MW", + "W", +} + + +def check_power_unit(value: str) -> PowerUnit: + if value in POWER_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {POWER_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/pressure_unit.py b/src/ansys/conceptev/core/generated/models/pressure_unit.py new file mode 100644 index 00000000..9eb95534 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/pressure_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +PressureUnit = Literal["kPa", "MPa", "Pa", "psi"] + +PRESSURE_UNIT_VALUES: set[PressureUnit] = { + "kPa", + "MPa", + "Pa", + "psi", +} + + +def check_pressure_unit(value: str) -> PressureUnit: + if value in PRESSURE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRESSURE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/ratio_unit.py b/src/ansys/conceptev/core/generated/models/ratio_unit.py new file mode 100644 index 00000000..d6a28f2d --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/ratio_unit.py @@ -0,0 +1,14 @@ +from typing import Literal + +RatioUnit = Literal["", "%"] + +RATIO_UNIT_VALUES: set[RatioUnit] = { + "", + "%", +} + + +def check_ratio_unit(value: str) -> RatioUnit: + if value in RATIO_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {RATIO_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/resistance_unit.py b/src/ansys/conceptev/core/generated/models/resistance_unit.py new file mode 100644 index 00000000..93937467 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/resistance_unit.py @@ -0,0 +1,13 @@ +from typing import Literal + +ResistanceUnit = Literal["ohm"] + +RESISTANCE_UNIT_VALUES: set[ResistanceUnit] = { + "ohm", +} + + +def check_resistance_unit(value: str) -> ResistanceUnit: + if value in RESISTANCE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {RESISTANCE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/road_efficiency_unit.py b/src/ansys/conceptev/core/generated/models/road_efficiency_unit.py new file mode 100644 index 00000000..383e4576 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/road_efficiency_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +RoadEfficiencyUnit = Literal["km/kWh", "m/J", "miles/kWh", "MPGe"] + +ROAD_EFFICIENCY_UNIT_VALUES: set[RoadEfficiencyUnit] = { + "km/kWh", + "m/J", + "miles/kWh", + "MPGe", +} + + +def check_road_efficiency_unit(value: str) -> RoadEfficiencyUnit: + if value in ROAD_EFFICIENCY_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ROAD_EFFICIENCY_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/save_state.py b/src/ansys/conceptev/core/generated/models/save_state.py new file mode 100644 index 00000000..e2a56fc5 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/save_state.py @@ -0,0 +1,14 @@ +from typing import Literal + +SaveState = Literal["saved", "unsaved"] + +SAVE_STATE_VALUES: set[SaveState] = { + "saved", + "unsaved", +} + + +def check_save_state(value: str) -> SaveState: + if value in SAVE_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SAVE_STATE_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/speed_unit.py b/src/ansys/conceptev/core/generated/models/speed_unit.py new file mode 100644 index 00000000..1a80f189 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/speed_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +SpeedUnit = Literal["ft/s", "km/hr", "m/s", "mph"] + +SPEED_UNIT_VALUES: set[SpeedUnit] = { + "ft/s", + "km/hr", + "m/s", + "mph", +} + + +def check_speed_unit(value: str) -> SpeedUnit: + if value in SPEED_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SPEED_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/static_requirement_input.py b/src/ansys/conceptev/core/generated/models/static_requirement_input.py new file mode 100644 index 00000000..54de9072 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/static_requirement_input.py @@ -0,0 +1,309 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="StaticRequirementInput") + + +@_attrs_define +class StaticRequirementInput: + """Static Requirement (Acceleration) Input.""" + + aero_id: str + mass_id: str + wheel_id: str + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "S1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + speed: float | Unset = 10.0 + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + front_axle_split: float | None | Unset = UNSET + steady_state: bool | Unset = False + requirement_input_type: Literal["static"] | Unset = "static" + acceleration: float | Unset = 1.0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + speed = self.speed + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + steady_state = self.steady_state + + requirement_input_type = self.requirement_input_type + + acceleration = self.acceleration + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if speed is not UNSET: + field_dict["speed"] = speed + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if steady_state is not UNSET: + field_dict["steady_state"] = steady_state + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + if acceleration is not UNSET: + field_dict["acceleration"] = acceleration + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + speed = d.pop("speed", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + steady_state = d.pop("steady_state", UNSET) + + requirement_input_type = cast( + Literal["static"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "static" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'static', got '{requirement_input_type}'" + ) + + acceleration = d.pop("acceleration", UNSET) + + static_requirement_input = cls( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + speed=speed, + altitude=altitude, + headwind=headwind, + gradient=gradient, + front_axle_split=front_axle_split, + steady_state=steady_state, + requirement_input_type=requirement_input_type, + acceleration=acceleration, + ) + + static_requirement_input.additional_properties = d + return static_requirement_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/static_requirement_output.py b/src/ansys/conceptev/core/generated/models/static_requirement_output.py new file mode 100644 index 00000000..d4b2f31a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/static_requirement_output.py @@ -0,0 +1,314 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_configuration_set import ComponentConfigurationSet + + +T = TypeVar("T", bound="StaticRequirementOutput") + + +@_attrs_define +class StaticRequirementOutput: + """Static Requirement (Acceleration) Output.""" + + id: str + aero_id: str + mass_id: str + wheel_id: str + speed: float + acceleration: float + part_type: Literal["requirement"] | Unset = "requirement" + deceleration_limit_id: None | str | Unset = UNSET + ancillary_load_id: None | str | Unset = UNSET + item_type: Literal["requirement"] | Unset = "requirement" + name: str | Unset = "S1" + description: str | Unset = "" + mass: None | Unset = UNSET + aero: None | Unset = UNSET + wheel: None | Unset = UNSET + deceleration_limit: None | Unset = UNSET + state_of_charge: float | Unset = 1.0 + component_configurations: ComponentConfigurationSet | Unset = UNSET + """ Set of component configurations. """ + ambient_temperature: float | Unset = 293.15 + ancillary_load: None | Unset = UNSET + altitude: float | Unset = 0.0 + headwind: float | Unset = 0.0 + gradient: float | Unset = 0.0 + front_axle_split: float | None | Unset = UNSET + steady_state: bool | Unset = False + requirement_input_type: Literal["static"] | Unset = "static" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + speed = self.speed + + acceleration = self.acceleration + + part_type = self.part_type + + deceleration_limit_id: None | str | Unset + if isinstance(self.deceleration_limit_id, Unset): + deceleration_limit_id = UNSET + else: + deceleration_limit_id = self.deceleration_limit_id + + ancillary_load_id: None | str | Unset + if isinstance(self.ancillary_load_id, Unset): + ancillary_load_id = UNSET + else: + ancillary_load_id = self.ancillary_load_id + + item_type = self.item_type + + name = self.name + + description = self.description + + mass = self.mass + + aero = self.aero + + wheel = self.wheel + + deceleration_limit = self.deceleration_limit + + state_of_charge = self.state_of_charge + + component_configurations: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_configurations, Unset): + component_configurations = self.component_configurations.to_dict() + + ambient_temperature = self.ambient_temperature + + ancillary_load = self.ancillary_load + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + front_axle_split: float | None | Unset + if isinstance(self.front_axle_split, Unset): + front_axle_split = UNSET + else: + front_axle_split = self.front_axle_split + + steady_state = self.steady_state + + requirement_input_type = self.requirement_input_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + "speed": speed, + "acceleration": acceleration, + } + ) + if part_type is not UNSET: + field_dict["part_type"] = part_type + if deceleration_limit_id is not UNSET: + field_dict["deceleration_limit_id"] = deceleration_limit_id + if ancillary_load_id is not UNSET: + field_dict["ancillary_load_id"] = ancillary_load_id + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + if deceleration_limit is not UNSET: + field_dict["deceleration_limit"] = deceleration_limit + if state_of_charge is not UNSET: + field_dict["state_of_charge"] = state_of_charge + if component_configurations is not UNSET: + field_dict["component_configurations"] = component_configurations + if ambient_temperature is not UNSET: + field_dict["ambient_temperature"] = ambient_temperature + if ancillary_load is not UNSET: + field_dict["ancillary_load"] = ancillary_load + if altitude is not UNSET: + field_dict["altitude"] = altitude + if headwind is not UNSET: + field_dict["headwind"] = headwind + if gradient is not UNSET: + field_dict["gradient"] = gradient + if front_axle_split is not UNSET: + field_dict["front_axle_split"] = front_axle_split + if steady_state is not UNSET: + field_dict["steady_state"] = steady_state + if requirement_input_type is not UNSET: + field_dict["requirement_input_type"] = requirement_input_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_configuration_set import ComponentConfigurationSet + + d = dict(src_dict) + id = d.pop("id") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + speed = d.pop("speed") + + acceleration = d.pop("acceleration") + + part_type = cast(Literal["requirement"] | Unset, d.pop("part_type", UNSET)) + if part_type != "requirement" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'requirement', got '{part_type}'") + + def _parse_deceleration_limit_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deceleration_limit_id = _parse_deceleration_limit_id(d.pop("deceleration_limit_id", UNSET)) + + def _parse_ancillary_load_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ancillary_load_id = _parse_ancillary_load_id(d.pop("ancillary_load_id", UNSET)) + + item_type = cast(Literal["requirement"] | Unset, d.pop("item_type", UNSET)) + if item_type != "requirement" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'requirement', got '{item_type}'") + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + mass = d.pop("mass", UNSET) + + aero = d.pop("aero", UNSET) + + wheel = d.pop("wheel", UNSET) + + deceleration_limit = d.pop("deceleration_limit", UNSET) + + state_of_charge = d.pop("state_of_charge", UNSET) + + _component_configurations = d.pop("component_configurations", UNSET) + component_configurations: ComponentConfigurationSet | Unset + if isinstance(_component_configurations, Unset): + component_configurations = UNSET + else: + component_configurations = ComponentConfigurationSet.from_dict( + _component_configurations + ) + + ambient_temperature = d.pop("ambient_temperature", UNSET) + + ancillary_load = d.pop("ancillary_load", UNSET) + + altitude = d.pop("altitude", UNSET) + + headwind = d.pop("headwind", UNSET) + + gradient = d.pop("gradient", UNSET) + + def _parse_front_axle_split(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + front_axle_split = _parse_front_axle_split(d.pop("front_axle_split", UNSET)) + + steady_state = d.pop("steady_state", UNSET) + + requirement_input_type = cast( + Literal["static"] | Unset, d.pop("requirement_input_type", UNSET) + ) + if requirement_input_type != "static" and not isinstance(requirement_input_type, Unset): + raise ValueError( + f"requirement_input_type must match const 'static', got '{requirement_input_type}'" + ) + + static_requirement_output = cls( + id=id, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + speed=speed, + acceleration=acceleration, + part_type=part_type, + deceleration_limit_id=deceleration_limit_id, + ancillary_load_id=ancillary_load_id, + item_type=item_type, + name=name, + description=description, + mass=mass, + aero=aero, + wheel=wheel, + deceleration_limit=deceleration_limit, + state_of_charge=state_of_charge, + component_configurations=component_configurations, + ambient_temperature=ambient_temperature, + ancillary_load=ancillary_load, + altitude=altitude, + headwind=headwind, + gradient=gradient, + front_axle_split=front_axle_split, + steady_state=steady_state, + requirement_input_type=requirement_input_type, + ) + + static_requirement_output.additional_properties = d + return static_requirement_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/surface_condition_traction_configs.py b/src/ansys/conceptev/core/generated/models/surface_condition_traction_configs.py new file mode 100644 index 00000000..ac1767bb --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/surface_condition_traction_configs.py @@ -0,0 +1,17 @@ +from typing import Literal + +SurfaceConditionTractionConfigs = Literal["Dry", "Snow", "Wet"] + +SURFACE_CONDITION_TRACTION_CONFIGS_VALUES: set[SurfaceConditionTractionConfigs] = { + "Dry", + "Snow", + "Wet", +} + + +def check_surface_condition_traction_configs(value: str) -> SurfaceConditionTractionConfigs: + if value in SURFACE_CONDITION_TRACTION_CONFIGS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {SURFACE_CONDITION_TRACTION_CONFIGS_VALUES!r}" + ) diff --git a/src/ansys/conceptev/core/generated/models/temperature_unit.py b/src/ansys/conceptev/core/generated/models/temperature_unit.py new file mode 100644 index 00000000..9c2e10ac --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/temperature_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +TemperatureUnit = Literal["K", "°C", "°F"] + +TEMPERATURE_UNIT_VALUES: set[TemperatureUnit] = { + "K", + "°C", + "°F", +} + + +def check_temperature_unit(value: str) -> TemperatureUnit: + if value in TEMPERATURE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TEMPERATURE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/thermal_model.py b/src/ansys/conceptev/core/generated/models/thermal_model.py new file mode 100644 index 00000000..9c058339 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_model.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.thermal_model_loss_map import ThermalModelLossMap + from ..models.thermal_model_temperature_map import ThermalModelTemperatureMap + from ..models.thermal_network import ThermalNetwork + + +T = TypeVar("T", bound="ThermalModel") + + +@_attrs_define +class ThermalModel: + """Thermal model. + + Contains the thermal network defined by nodes and edges, and mappings of which nodes + correspond to which losses and temperatures. + + """ + + network: ThermalNetwork + """ Lumped parameter thermal network. + + It is constructed from sets of nodes and edges (connections) at different speeds + and flow rates. + + Fields: + speed_dict (dict): Dictionary mapping indices to speed values. + flow_rate_dict (dict): Dictionary mapping indices to flow rate values. + edges (dict): Dictionary mapping indices to edge lists. + nodes (dict): Dictionary mapping indices to node lists. """ + loss_map: ThermalModelLossMap + temperature_map: ThermalModelTemperatureMap + component_file_type: Literal["ThermalModel"] | Unset = "ThermalModel" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + network = self.network.to_dict() + + loss_map = self.loss_map.to_dict() + + temperature_map = self.temperature_map.to_dict() + + component_file_type = self.component_file_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "network": network, + "loss_map": loss_map, + "temperature_map": temperature_map, + } + ) + if component_file_type is not UNSET: + field_dict["component_file_type"] = component_file_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_loss_map import ThermalModelLossMap + from ..models.thermal_model_temperature_map import ThermalModelTemperatureMap + from ..models.thermal_network import ThermalNetwork + + d = dict(src_dict) + network = ThermalNetwork.from_dict(d.pop("network")) + + loss_map = ThermalModelLossMap.from_dict(d.pop("loss_map")) + + temperature_map = ThermalModelTemperatureMap.from_dict(d.pop("temperature_map")) + + component_file_type = cast( + Literal["ThermalModel"] | Unset, d.pop("component_file_type", UNSET) + ) + if component_file_type != "ThermalModel" and not isinstance(component_file_type, Unset): + raise ValueError( + f"component_file_type must match const 'ThermalModel', got '{component_file_type}'" + ) + + thermal_model = cls( + network=network, + loss_map=loss_map, + temperature_map=temperature_map, + component_file_type=component_file_type, + ) + + thermal_model.additional_properties = d + return thermal_model + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_model_loss_map.py b/src/ansys/conceptev/core/generated/models/thermal_model_loss_map.py new file mode 100644 index 00000000..856eadb9 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_model_loss_map.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_model_loss_map_additional_property import ( + ThermalModelLossMapAdditionalProperty, + ) + + +T = TypeVar("T", bound="ThermalModelLossMap") + + +@_attrs_define +class ThermalModelLossMap: + additional_properties: dict[str, ThermalModelLossMapAdditionalProperty] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_loss_map_additional_property import ( + ThermalModelLossMapAdditionalProperty, + ) + + d = dict(src_dict) + thermal_model_loss_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ThermalModelLossMapAdditionalProperty.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + thermal_model_loss_map.additional_properties = additional_properties + return thermal_model_loss_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ThermalModelLossMapAdditionalProperty: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ThermalModelLossMapAdditionalProperty) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_model_loss_map_additional_property.py b/src/ansys/conceptev/core/generated/models/thermal_model_loss_map_additional_property.py new file mode 100644 index 00000000..c7c31bdc --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_model_loss_map_additional_property.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalModelLossMapAdditionalProperty") + + +@_attrs_define +class ThermalModelLossMapAdditionalProperty: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_model_loss_map_additional_property = cls() + + thermal_model_loss_map_additional_property.additional_properties = d + return thermal_model_loss_map_additional_property + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map.py b/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map.py new file mode 100644 index 00000000..66fcdc08 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, + ) + + +T = TypeVar("T", bound="ThermalModelTemperatureMap") + + +@_attrs_define +class ThermalModelTemperatureMap: + additional_properties: dict[str, ThermalModelTemperatureMapAdditionalProperty] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_model_temperature_map_additional_property import ( + ThermalModelTemperatureMapAdditionalProperty, + ) + + d = dict(src_dict) + thermal_model_temperature_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ThermalModelTemperatureMapAdditionalProperty.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + thermal_model_temperature_map.additional_properties = additional_properties + return thermal_model_temperature_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ThermalModelTemperatureMapAdditionalProperty: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ThermalModelTemperatureMapAdditionalProperty) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map_additional_property.py b/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map_additional_property.py new file mode 100644 index 00000000..be35665f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_model_temperature_map_additional_property.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalModelTemperatureMapAdditionalProperty") + + +@_attrs_define +class ThermalModelTemperatureMapAdditionalProperty: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_model_temperature_map_additional_property = cls() + + thermal_model_temperature_map_additional_property.additional_properties = d + return thermal_model_temperature_map_additional_property + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_network.py b/src/ansys/conceptev/core/generated/models/thermal_network.py new file mode 100644 index 00000000..dce931f2 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_network.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.thermal_network_edges import ThermalNetworkEdges + from ..models.thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict + from ..models.thermal_network_nodes import ThermalNetworkNodes + from ..models.thermal_network_speed_dict import ThermalNetworkSpeedDict + + +T = TypeVar("T", bound="ThermalNetwork") + + +@_attrs_define +class ThermalNetwork: + """Lumped parameter thermal network. + + It is constructed from sets of nodes and edges (connections) at different speeds + and flow rates. + + Fields: + speed_dict (dict): Dictionary mapping indices to speed values. + flow_rate_dict (dict): Dictionary mapping indices to flow rate values. + edges (dict): Dictionary mapping indices to edge lists. + nodes (dict): Dictionary mapping indices to node lists. + + """ + + edges: ThermalNetworkEdges + nodes: ThermalNetworkNodes + speed_dict: ThermalNetworkSpeedDict + flow_rate_dict: ThermalNetworkFlowRateDict + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + edges = self.edges.to_dict() + + nodes = self.nodes.to_dict() + + speed_dict = self.speed_dict.to_dict() + + flow_rate_dict = self.flow_rate_dict.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "edges": edges, + "nodes": nodes, + "speed_dict": speed_dict, + "flow_rate_dict": flow_rate_dict, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.thermal_network_edges import ThermalNetworkEdges + from ..models.thermal_network_flow_rate_dict import ThermalNetworkFlowRateDict + from ..models.thermal_network_nodes import ThermalNetworkNodes + from ..models.thermal_network_speed_dict import ThermalNetworkSpeedDict + + d = dict(src_dict) + edges = ThermalNetworkEdges.from_dict(d.pop("edges")) + + nodes = ThermalNetworkNodes.from_dict(d.pop("nodes")) + + speed_dict = ThermalNetworkSpeedDict.from_dict(d.pop("speed_dict")) + + flow_rate_dict = ThermalNetworkFlowRateDict.from_dict(d.pop("flow_rate_dict")) + + thermal_network = cls( + edges=edges, + nodes=nodes, + speed_dict=speed_dict, + flow_rate_dict=flow_rate_dict, + ) + + thermal_network.additional_properties = d + return thermal_network + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_network_edges.py b/src/ansys/conceptev/core/generated/models/thermal_network_edges.py new file mode 100644 index 00000000..5c9613fa --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_network_edges.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.edge import Edge + + +T = TypeVar("T", bound="ThermalNetworkEdges") + + +@_attrs_define +class ThermalNetworkEdges: + additional_properties: dict[str, list[Edge]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = [] + for additional_property_item_data in prop: + additional_property_item = additional_property_item_data.to_dict() + field_dict[prop_name].append(additional_property_item) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.edge import Edge + + d = dict(src_dict) + thermal_network_edges = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = [] + _additional_property = prop_dict + for additional_property_item_data in _additional_property: + additional_property_item = Edge.from_dict(additional_property_item_data) + + additional_property.append(additional_property_item) + + additional_properties[prop_name] = additional_property + + thermal_network_edges.additional_properties = additional_properties + return thermal_network_edges + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[Edge]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[Edge]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_network_flow_rate_dict.py b/src/ansys/conceptev/core/generated/models/thermal_network_flow_rate_dict.py new file mode 100644 index 00000000..01cc6cfe --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_network_flow_rate_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalNetworkFlowRateDict") + + +@_attrs_define +class ThermalNetworkFlowRateDict: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_network_flow_rate_dict = cls() + + thermal_network_flow_rate_dict.additional_properties = d + return thermal_network_flow_rate_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_network_nodes.py b/src/ansys/conceptev/core/generated/models/thermal_network_nodes.py new file mode 100644 index 00000000..3b7b407c --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_network_nodes.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.node import Node + + +T = TypeVar("T", bound="ThermalNetworkNodes") + + +@_attrs_define +class ThermalNetworkNodes: + additional_properties: dict[str, list[Node]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = [] + for additional_property_item_data in prop: + additional_property_item = additional_property_item_data.to_dict() + field_dict[prop_name].append(additional_property_item) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node import Node + + d = dict(src_dict) + thermal_network_nodes = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = [] + _additional_property = prop_dict + for additional_property_item_data in _additional_property: + additional_property_item = Node.from_dict(additional_property_item_data) + + additional_property.append(additional_property_item) + + additional_properties[prop_name] = additional_property + + thermal_network_nodes.additional_properties = additional_properties + return thermal_network_nodes + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[Node]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[Node]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/thermal_network_speed_dict.py b/src/ansys/conceptev/core/generated/models/thermal_network_speed_dict.py new file mode 100644 index 00000000..04d3db0f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/thermal_network_speed_dict.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ThermalNetworkSpeedDict") + + +@_attrs_define +class ThermalNetworkSpeedDict: + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + thermal_network_speed_dict = cls() + + thermal_network_speed_dict.additional_properties = d + return thermal_network_speed_dict + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/time_unit.py b/src/ansys/conceptev/core/generated/models/time_unit.py new file mode 100644 index 00000000..db41cad5 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/time_unit.py @@ -0,0 +1,16 @@ +from typing import Literal + +TimeUnit = Literal["hr", "min", "ms", "s"] + +TIME_UNIT_VALUES: set[TimeUnit] = { + "hr", + "min", + "ms", + "s", +} + + +def check_time_unit(value: str) -> TimeUnit: + if value in TIME_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TIME_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/torque_unit.py b/src/ansys/conceptev/core/generated/models/torque_unit.py new file mode 100644 index 00000000..fd3290da --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/torque_unit.py @@ -0,0 +1,17 @@ +from typing import Literal + +TorqueUnit = Literal["dyn·cm", "ft·lbf", "kN·m", "MN·m", "N·m"] + +TORQUE_UNIT_VALUES: set[TorqueUnit] = { + "dyn·cm", + "ft·lbf", + "kN·m", + "MN·m", + "N·m", +} + + +def check_torque_unit(value: str) -> TorqueUnit: + if value in TORQUE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TORQUE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_input.py b/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_input.py new file mode 100644 index 00000000..eb70bec7 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_input.py @@ -0,0 +1,217 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + +T = TypeVar("T", bound="TotalTractiveTorqueGraphInput") + + +@_attrs_define +class TotalTractiveTorqueGraphInput: + """Total Tractive Torque Graph Input.""" + + max_speed: float + step_size_speed: float + acceleration: float + altitude: float + headwind: float + gradient: float + aero_id: str + mass_id: str + wheel_id: str + mass: Mass | None | Unset = UNSET + aero: Aero | None | Unset = UNSET + wheel: None | Unset | WheelInput = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + max_speed = self.max_speed + + step_size_speed = self.step_size_speed + + acceleration = self.acceleration + + altitude = self.altitude + + headwind = self.headwind + + gradient = self.gradient + + aero_id = self.aero_id + + mass_id = self.mass_id + + wheel_id = self.wheel_id + + mass: dict[str, Any] | None | Unset + if isinstance(self.mass, Unset): + mass = UNSET + elif isinstance(self.mass, Mass): + mass = self.mass.to_dict() + else: + mass = self.mass + + aero: dict[str, Any] | None | Unset + if isinstance(self.aero, Unset): + aero = UNSET + elif isinstance(self.aero, Aero): + aero = self.aero.to_dict() + else: + aero = self.aero + + wheel: dict[str, Any] | None | Unset + if isinstance(self.wheel, Unset): + wheel = UNSET + elif isinstance(self.wheel, WheelInput): + wheel = self.wheel.to_dict() + else: + wheel = self.wheel + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "max_speed": max_speed, + "step_size_speed": step_size_speed, + "acceleration": acceleration, + "altitude": altitude, + "headwind": headwind, + "gradient": gradient, + "aero_id": aero_id, + "mass_id": mass_id, + "wheel_id": wheel_id, + } + ) + if mass is not UNSET: + field_dict["mass"] = mass + if aero is not UNSET: + field_dict["aero"] = aero + if wheel is not UNSET: + field_dict["wheel"] = wheel + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aero import Aero + from ..models.mass import Mass + from ..models.wheel_input import WheelInput + + d = dict(src_dict) + max_speed = d.pop("max_speed") + + step_size_speed = d.pop("step_size_speed") + + acceleration = d.pop("acceleration") + + altitude = d.pop("altitude") + + headwind = d.pop("headwind") + + gradient = d.pop("gradient") + + aero_id = d.pop("aero_id") + + mass_id = d.pop("mass_id") + + wheel_id = d.pop("wheel_id") + + def _parse_mass(data: object) -> Mass | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + mass_type_0 = Mass.from_dict(data) + + return mass_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Mass | None | Unset, data) + + mass = _parse_mass(d.pop("mass", UNSET)) + + def _parse_aero(data: object) -> Aero | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + aero_type_0 = Aero.from_dict(data) + + return aero_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Aero | None | Unset, data) + + aero = _parse_aero(d.pop("aero", UNSET)) + + def _parse_wheel(data: object) -> None | Unset | WheelInput: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + wheel_type_0 = WheelInput.from_dict(data) + + return wheel_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelInput, data) + + wheel = _parse_wheel(d.pop("wheel", UNSET)) + + total_tractive_torque_graph_input = cls( + max_speed=max_speed, + step_size_speed=step_size_speed, + acceleration=acceleration, + altitude=altitude, + headwind=headwind, + gradient=gradient, + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + mass=mass, + aero=aero, + wheel=wheel, + ) + + total_tractive_torque_graph_input.additional_properties = d + return total_tractive_torque_graph_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_output.py b/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_output.py new file mode 100644 index 00000000..8ec4b1ee --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/total_tractive_torque_graph_output.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TotalTractiveTorqueGraphOutput") + + +@_attrs_define +class TotalTractiveTorqueGraphOutput: + """Total Tractive Torque Graph Output.""" + + speeds: list[float] + acceleration: float + total_tractive_torques: list[float] + aero_forces: list[float] + mass_forces: list[float] + total_forces: list[float] + total_tractive_powers: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + speeds = self.speeds + + acceleration = self.acceleration + + total_tractive_torques = self.total_tractive_torques + + aero_forces = self.aero_forces + + mass_forces = self.mass_forces + + total_forces = self.total_forces + + total_tractive_powers = self.total_tractive_powers + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "speeds": speeds, + "acceleration": acceleration, + "total_tractive_torques": total_tractive_torques, + "aero_forces": aero_forces, + "mass_forces": mass_forces, + "total_forces": total_forces, + "total_tractive_powers": total_tractive_powers, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + speeds = cast(list[float], d.pop("speeds")) + + acceleration = d.pop("acceleration") + + total_tractive_torques = cast(list[float], d.pop("total_tractive_torques")) + + aero_forces = cast(list[float], d.pop("aero_forces")) + + mass_forces = cast(list[float], d.pop("mass_forces")) + + total_forces = cast(list[float], d.pop("total_forces")) + + total_tractive_powers = cast(list[float], d.pop("total_tractive_powers")) + + total_tractive_torque_graph_output = cls( + speeds=speeds, + acceleration=acceleration, + total_tractive_torques=total_tractive_torques, + aero_forces=aero_forces, + mass_forces=mass_forces, + total_forces=total_forces, + total_tractive_powers=total_tractive_powers, + ) + + total_tractive_torque_graph_output.additional_properties = d + return total_tractive_torque_graph_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_input.py b/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_input.py new file mode 100644 index 00000000..772a06fc --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_input.py @@ -0,0 +1,190 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TransmissionLossCoefficientsInput") + + +@_attrs_define +class TransmissionLossCoefficientsInput: + """Transmission Loss Coefficients Input.""" + + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Loss Coefficients Transmission" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["TransmissionLossCoefficients"] | Unset = "TransmissionLossCoefficients" + gear_ratios: list[float] | Unset = UNSET + headline_efficiencies: list[float] | Unset = UNSET + max_torque: float | Unset = 200.0 + max_speed: float | Unset = 1047.1975499999983 + static_drags: list[float] | Unset = UNSET + friction_ratios: list[float] | Unset = UNSET + shift_time: float | Unset = 0.0 + moment_of_inertia_wheel_side: float | Unset = 0.0 + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + gear_ratios: list[float] | Unset = UNSET + if not isinstance(self.gear_ratios, Unset): + gear_ratios = self.gear_ratios + + headline_efficiencies: list[float] | Unset = UNSET + if not isinstance(self.headline_efficiencies, Unset): + headline_efficiencies = self.headline_efficiencies + + max_torque = self.max_torque + + max_speed = self.max_speed + + static_drags: list[float] | Unset = UNSET + if not isinstance(self.static_drags, Unset): + static_drags = self.static_drags + + friction_ratios: list[float] | Unset = UNSET + if not isinstance(self.friction_ratios, Unset): + friction_ratios = self.friction_ratios + + shift_time = self.shift_time + + moment_of_inertia_wheel_side = self.moment_of_inertia_wheel_side + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if gear_ratios is not UNSET: + field_dict["gear_ratios"] = gear_ratios + if headline_efficiencies is not UNSET: + field_dict["headline_efficiencies"] = headline_efficiencies + if max_torque is not UNSET: + field_dict["max_torque"] = max_torque + if max_speed is not UNSET: + field_dict["max_speed"] = max_speed + if static_drags is not UNSET: + field_dict["static_drags"] = static_drags + if friction_ratios is not UNSET: + field_dict["friction_ratios"] = friction_ratios + if shift_time is not UNSET: + field_dict["shift_time"] = shift_time + if moment_of_inertia_wheel_side is not UNSET: + field_dict["moment_of_inertia_wheel_side"] = moment_of_inertia_wheel_side + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["TransmissionLossCoefficients"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "TransmissionLossCoefficients" and not isinstance( + component_type, Unset + ): + raise ValueError( + f"component_type must match const 'TransmissionLossCoefficients', got '{component_type}'" + ) + + gear_ratios = cast(list[float], d.pop("gear_ratios", UNSET)) + + headline_efficiencies = cast(list[float], d.pop("headline_efficiencies", UNSET)) + + max_torque = d.pop("max_torque", UNSET) + + max_speed = d.pop("max_speed", UNSET) + + static_drags = cast(list[float], d.pop("static_drags", UNSET)) + + friction_ratios = cast(list[float], d.pop("friction_ratios", UNSET)) + + shift_time = d.pop("shift_time", UNSET) + + moment_of_inertia_wheel_side = d.pop("moment_of_inertia_wheel_side", UNSET) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + transmission_loss_coefficients_input = cls( + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + gear_ratios=gear_ratios, + headline_efficiencies=headline_efficiencies, + max_torque=max_torque, + max_speed=max_speed, + static_drags=static_drags, + friction_ratios=friction_ratios, + shift_time=shift_time, + moment_of_inertia_wheel_side=moment_of_inertia_wheel_side, + part_type=part_type, + ) + + transmission_loss_coefficients_input.additional_properties = d + return transmission_loss_coefficients_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_output.py b/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_output.py new file mode 100644 index 00000000..59541f8f --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/transmission_loss_coefficients_output.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TransmissionLossCoefficientsOutput") + + +@_attrs_define +class TransmissionLossCoefficientsOutput: + """Transmission Loss Coefficients Output.""" + + id: str + item_type: Literal["component"] | Unset = "component" + name: str | Unset = "Default Loss Coefficients Transmission" + mass: float | Unset = 0.0 + moment_of_inertia: float | Unset = 0.0 + cost: float | Unset = 0.0 + component_type: Literal["TransmissionLossCoefficients"] | Unset = "TransmissionLossCoefficients" + gear_ratios: list[float] | Unset = UNSET + headline_efficiencies: list[float] | Unset = UNSET + max_torque: float | Unset = 200.0 + max_speed: float | Unset = 1047.1975499999983 + static_drags: list[float] | Unset = UNSET + friction_ratios: list[float] | Unset = UNSET + shift_time: float | Unset = 0.0 + moment_of_inertia_wheel_side: float | Unset = 0.0 + part_type: Literal["component"] | Unset = "component" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + moment_of_inertia = self.moment_of_inertia + + cost = self.cost + + component_type = self.component_type + + gear_ratios: list[float] | Unset = UNSET + if not isinstance(self.gear_ratios, Unset): + gear_ratios = self.gear_ratios + + headline_efficiencies: list[float] | Unset = UNSET + if not isinstance(self.headline_efficiencies, Unset): + headline_efficiencies = self.headline_efficiencies + + max_torque = self.max_torque + + max_speed = self.max_speed + + static_drags: list[float] | Unset = UNSET + if not isinstance(self.static_drags, Unset): + static_drags = self.static_drags + + friction_ratios: list[float] | Unset = UNSET + if not isinstance(self.friction_ratios, Unset): + friction_ratios = self.friction_ratios + + shift_time = self.shift_time + + moment_of_inertia_wheel_side = self.moment_of_inertia_wheel_side + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if moment_of_inertia is not UNSET: + field_dict["moment_of_inertia"] = moment_of_inertia + if cost is not UNSET: + field_dict["cost"] = cost + if component_type is not UNSET: + field_dict["component_type"] = component_type + if gear_ratios is not UNSET: + field_dict["gear_ratios"] = gear_ratios + if headline_efficiencies is not UNSET: + field_dict["headline_efficiencies"] = headline_efficiencies + if max_torque is not UNSET: + field_dict["max_torque"] = max_torque + if max_speed is not UNSET: + field_dict["max_speed"] = max_speed + if static_drags is not UNSET: + field_dict["static_drags"] = static_drags + if friction_ratios is not UNSET: + field_dict["friction_ratios"] = friction_ratios + if shift_time is not UNSET: + field_dict["shift_time"] = shift_time + if moment_of_inertia_wheel_side is not UNSET: + field_dict["moment_of_inertia_wheel_side"] = moment_of_inertia_wheel_side + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["component"] | Unset, d.pop("item_type", UNSET)) + if item_type != "component" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'component', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + moment_of_inertia = d.pop("moment_of_inertia", UNSET) + + cost = d.pop("cost", UNSET) + + component_type = cast( + Literal["TransmissionLossCoefficients"] | Unset, d.pop("component_type", UNSET) + ) + if component_type != "TransmissionLossCoefficients" and not isinstance( + component_type, Unset + ): + raise ValueError( + f"component_type must match const 'TransmissionLossCoefficients', got '{component_type}'" + ) + + gear_ratios = cast(list[float], d.pop("gear_ratios", UNSET)) + + headline_efficiencies = cast(list[float], d.pop("headline_efficiencies", UNSET)) + + max_torque = d.pop("max_torque", UNSET) + + max_speed = d.pop("max_speed", UNSET) + + static_drags = cast(list[float], d.pop("static_drags", UNSET)) + + friction_ratios = cast(list[float], d.pop("friction_ratios", UNSET)) + + shift_time = d.pop("shift_time", UNSET) + + moment_of_inertia_wheel_side = d.pop("moment_of_inertia_wheel_side", UNSET) + + part_type = cast(Literal["component"] | Unset, d.pop("part_type", UNSET)) + if part_type != "component" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'component', got '{part_type}'") + + transmission_loss_coefficients_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + moment_of_inertia=moment_of_inertia, + cost=cost, + component_type=component_type, + gear_ratios=gear_ratios, + headline_efficiencies=headline_efficiencies, + max_torque=max_torque, + max_speed=max_speed, + static_drags=static_drags, + friction_ratios=friction_ratios, + shift_time=shift_time, + moment_of_inertia_wheel_side=moment_of_inertia_wheel_side, + part_type=part_type, + ) + + transmission_loss_coefficients_output.additional_properties = d + return transmission_loss_coefficients_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/unit_choices.py b/src/ansys/conceptev/core/generated/models/unit_choices.py new file mode 100644 index 00000000..3cbb7efb --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/unit_choices.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap + + +T = TypeVar("T", bound="UnitChoices") + + +@_attrs_define +class UnitChoices: + """Unit Choice for the analysis. + + We might not need all of these. + We might want to create preset groups of these (eg. MKS, Imperial etc) + + """ + + unit_type_to_unit_map: UnitChoicesUnitTypeToUnitMap | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + unit_type_to_unit_map: dict[str, Any] | Unset = UNSET + if not isinstance(self.unit_type_to_unit_map, Unset): + unit_type_to_unit_map = self.unit_type_to_unit_map.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if unit_type_to_unit_map is not UNSET: + field_dict["unit_type_to_unit_map"] = unit_type_to_unit_map + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.unit_choices_unit_type_to_unit_map import UnitChoicesUnitTypeToUnitMap + + d = dict(src_dict) + _unit_type_to_unit_map = d.pop("unit_type_to_unit_map", UNSET) + unit_type_to_unit_map: UnitChoicesUnitTypeToUnitMap | Unset + if isinstance(_unit_type_to_unit_map, Unset): + unit_type_to_unit_map = UNSET + else: + unit_type_to_unit_map = UnitChoicesUnitTypeToUnitMap.from_dict(_unit_type_to_unit_map) + + unit_choices = cls( + unit_type_to_unit_map=unit_type_to_unit_map, + ) + + unit_choices.additional_properties = d + return unit_choices + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/unit_choices_unit_type_to_unit_map.py b/src/ansys/conceptev/core/generated/models/unit_choices_unit_type_to_unit_map.py new file mode 100644 index 00000000..52413fff --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/unit_choices_unit_type_to_unit_map.py @@ -0,0 +1,491 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.acceleration_unit import AccelerationUnit, check_acceleration_unit +from ..models.angle_unit import AngleUnit, check_angle_unit +from ..models.angular_acceleration_unit import ( + AngularAccelerationUnit, + check_angular_acceleration_unit, +) +from ..models.angular_speed_unit import AngularSpeedUnit, check_angular_speed_unit +from ..models.area_unit import AreaUnit, check_area_unit +from ..models.current_unit import CurrentUnit, check_current_unit +from ..models.density_unit import DensityUnit, check_density_unit +from ..models.electric_charge_unit import ElectricChargeUnit, check_electric_charge_unit +from ..models.electrical_energy_unit import ElectricalEnergyUnit, check_electrical_energy_unit +from ..models.electrical_power_unit import ElectricalPowerUnit, check_electrical_power_unit +from ..models.energy_unit import EnergyUnit, check_energy_unit +from ..models.force_unit import ForceUnit, check_force_unit +from ..models.frequency_unit import FrequencyUnit, check_frequency_unit +from ..models.inertia_unit import InertiaUnit, check_inertia_unit +from ..models.length_unit import LengthUnit, check_length_unit +from ..models.mass_unit import MassUnit, check_mass_unit +from ..models.power_unit import PowerUnit, check_power_unit +from ..models.pressure_unit import PressureUnit, check_pressure_unit +from ..models.ratio_unit import RatioUnit, check_ratio_unit +from ..models.resistance_unit import ResistanceUnit, check_resistance_unit +from ..models.road_efficiency_unit import RoadEfficiencyUnit, check_road_efficiency_unit +from ..models.speed_unit import SpeedUnit, check_speed_unit +from ..models.temperature_unit import TemperatureUnit, check_temperature_unit +from ..models.time_unit import TimeUnit, check_time_unit +from ..models.torque_unit import TorqueUnit, check_torque_unit +from ..models.voltage_unit import VoltageUnit, check_voltage_unit +from ..models.volume_unit import VolumeUnit, check_volume_unit +from ..models.volumetric_flow_rate_unit import ( + VolumetricFlowRateUnit, + check_volumetric_flow_rate_unit, +) + +T = TypeVar("T", bound="UnitChoicesUnitTypeToUnitMap") + + +@_attrs_define +class UnitChoicesUnitTypeToUnitMap: + additional_properties: dict[ + str, + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit, + ] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + if isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + elif isinstance(prop, str): + field_dict[prop_name] = prop + else: + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + unit_choices_unit_type_to_unit_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property( + data: object, + ) -> ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ): + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_0 = check_mass_unit(data) + + return additional_property_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_1 = check_time_unit(data) + + return additional_property_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_2 = check_force_unit(data) + + return additional_property_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_3 = check_torque_unit(data) + + return additional_property_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_4 = check_temperature_unit(data) + + return additional_property_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_5 = check_length_unit(data) + + return additional_property_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_6 = check_area_unit(data) + + return additional_property_type_6 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_7 = check_volume_unit(data) + + return additional_property_type_7 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_8 = check_speed_unit(data) + + return additional_property_type_8 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_9 = check_acceleration_unit(data) + + return additional_property_type_9 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_10 = check_angular_speed_unit(data) + + return additional_property_type_10 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_11 = check_angular_acceleration_unit(data) + + return additional_property_type_11 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_12 = check_energy_unit(data) + + return additional_property_type_12 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_13 = check_power_unit(data) + + return additional_property_type_13 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_14 = check_density_unit(data) + + return additional_property_type_14 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_15 = check_inertia_unit(data) + + return additional_property_type_15 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_16 = check_pressure_unit(data) + + return additional_property_type_16 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_17 = check_ratio_unit(data) + + return additional_property_type_17 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_18 = check_voltage_unit(data) + + return additional_property_type_18 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_19 = check_current_unit(data) + + return additional_property_type_19 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_20 = check_resistance_unit(data) + + return additional_property_type_20 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_21 = check_electric_charge_unit(data) + + return additional_property_type_21 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_22 = check_electrical_energy_unit(data) + + return additional_property_type_22 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_23 = check_electrical_power_unit(data) + + return additional_property_type_23 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_24 = check_angle_unit(data) + + return additional_property_type_24 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_25 = check_road_efficiency_unit(data) + + return additional_property_type_25 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, str): + raise TypeError() + additional_property_type_26 = check_frequency_unit(data) + + return additional_property_type_26 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, str): + raise TypeError() + additional_property_type_27 = check_volumetric_flow_rate_unit(data) + + return additional_property_type_27 + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + unit_choices_unit_type_to_unit_map.additional_properties = additional_properties + return unit_choices_unit_type_to_unit_map + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__( + self, key: str + ) -> ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ): + return self.additional_properties[key] + + def __setitem__( + self, + key: str, + value: ( + AccelerationUnit + | AngleUnit + | AngularAccelerationUnit + | AngularSpeedUnit + | AreaUnit + | CurrentUnit + | DensityUnit + | ElectricalEnergyUnit + | ElectricalPowerUnit + | ElectricChargeUnit + | EnergyUnit + | ForceUnit + | FrequencyUnit + | InertiaUnit + | LengthUnit + | MassUnit + | PowerUnit + | PressureUnit + | RatioUnit + | ResistanceUnit + | RoadEfficiencyUnit + | SpeedUnit + | TemperatureUnit + | TimeUnit + | TorqueUnit + | VoltageUnit + | VolumetricFlowRateUnit + | VolumeUnit + ), + ) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/validation_error.py b/src/ansys/conceptev/core/generated/models/validation_error.py new file mode 100644 index 00000000..2eeff936 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/validation_error.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error_context import ValidationErrorContext + + +T = TypeVar("T", bound="ValidationError") + + +@_attrs_define +class ValidationError: + loc: list[int | str] + msg: str + type_: str + input_: Any | Unset = UNSET + ctx: ValidationErrorContext | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + loc = [] + for loc_item_data in self.loc: + loc_item: int | str + loc_item = loc_item_data + loc.append(loc_item) + + msg = self.msg + + type_ = self.type_ + + input_ = self.input_ + + ctx: dict[str, Any] | Unset = UNSET + if not isinstance(self.ctx, Unset): + ctx = self.ctx.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "loc": loc, + "msg": msg, + "type": type_, + } + ) + if input_ is not UNSET: + field_dict["input"] = input_ + if ctx is not UNSET: + field_dict["ctx"] = ctx + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error_context import ValidationErrorContext + + d = dict(src_dict) + loc = [] + _loc = d.pop("loc") + for loc_item_data in _loc: + + def _parse_loc_item(data: object) -> int | str: + return cast(int | str, data) + + loc_item = _parse_loc_item(loc_item_data) + + loc.append(loc_item) + + msg = d.pop("msg") + + type_ = d.pop("type") + + input_ = d.pop("input", UNSET) + + _ctx = d.pop("ctx", UNSET) + ctx: ValidationErrorContext | Unset + if isinstance(_ctx, Unset): + ctx = UNSET + else: + ctx = ValidationErrorContext.from_dict(_ctx) + + validation_error = cls( + loc=loc, + msg=msg, + type_=type_, + input_=input_, + ctx=ctx, + ) + + validation_error.additional_properties = d + return validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/validation_error_context.py b/src/ansys/conceptev/core/generated/models/validation_error_context.py new file mode 100644 index 00000000..124b115a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/validation_error_context.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidationErrorContext") + + +@_attrs_define +class ValidationErrorContext: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + validation_error_context = cls() + + validation_error_context.additional_properties = d + return validation_error_context + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/voltage_unit.py b/src/ansys/conceptev/core/generated/models/voltage_unit.py new file mode 100644 index 00000000..db912d1a --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/voltage_unit.py @@ -0,0 +1,15 @@ +from typing import Literal + +VoltageUnit = Literal["kV", "mV", "V"] + +VOLTAGE_UNIT_VALUES: set[VoltageUnit] = { + "kV", + "mV", + "V", +} + + +def check_voltage_unit(value: str) -> VoltageUnit: + if value in VOLTAGE_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {VOLTAGE_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/volume_unit.py b/src/ansys/conceptev/core/generated/models/volume_unit.py new file mode 100644 index 00000000..0d98490b --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/volume_unit.py @@ -0,0 +1,21 @@ +from typing import Literal + +VolumeUnit = Literal["cc", "cm³", "ft³", "in³", "l", "ml", "mm³", "m³", "yd³"] + +VOLUME_UNIT_VALUES: set[VolumeUnit] = { + "cc", + "cm³", + "ft³", + "in³", + "l", + "ml", + "mm³", + "m³", + "yd³", +} + + +def check_volume_unit(value: str) -> VolumeUnit: + if value in VOLUME_UNIT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {VOLUME_UNIT_VALUES!r}") diff --git a/src/ansys/conceptev/core/generated/models/volumetric_flow_rate_unit.py b/src/ansys/conceptev/core/generated/models/volumetric_flow_rate_unit.py new file mode 100644 index 00000000..71cf19b6 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/volumetric_flow_rate_unit.py @@ -0,0 +1,18 @@ +from typing import Literal + +VolumetricFlowRateUnit = Literal["l/min", "l/s", "m³/min", "m³/s"] + +VOLUMETRIC_FLOW_RATE_UNIT_VALUES: set[VolumetricFlowRateUnit] = { + "l/min", + "l/s", + "m³/min", + "m³/s", +} + + +def check_volumetric_flow_rate_unit(value: str) -> VolumetricFlowRateUnit: + if value in VOLUMETRIC_FLOW_RATE_UNIT_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {VOLUMETRIC_FLOW_RATE_UNIT_VALUES!r}" + ) diff --git a/src/ansys/conceptev/core/generated/models/wheel_input.py b/src/ansys/conceptev/core/generated/models/wheel_input.py new file mode 100644 index 00000000..becb3f7c --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/wheel_input.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.surface_condition_traction_configs import ( + SurfaceConditionTractionConfigs, + check_surface_condition_traction_configs, +) +from ..models.wheel_rolling_resistance_configs import ( + WheelRollingResistanceConfigs, + check_wheel_rolling_resistance_configs, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WheelInput") + + +@_attrs_define +class WheelInput: + """Wheel Input.""" + + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Wheel" + mass: float | Unset = 0.0 + cost: float | Unset = 0.0 + rolling_radius: float | Unset = 0.3 + rolling_resistance_coefficient: float | Unset = 0.02 + rolling_resistance_key: None | Unset | WheelRollingResistanceConfigs = UNSET + traction_coefficient: float | Unset = 0.9 + traction_coefficient_key: None | SurfaceConditionTractionConfigs | Unset = UNSET + config_type: Literal["wheel"] | Unset = "wheel" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + item_type = self.item_type + + name = self.name + + mass = self.mass + + cost = self.cost + + rolling_radius = self.rolling_radius + + rolling_resistance_coefficient = self.rolling_resistance_coefficient + + rolling_resistance_key: None | str | Unset + if isinstance(self.rolling_resistance_key, Unset): + rolling_resistance_key = UNSET + elif isinstance(self.rolling_resistance_key, str): + rolling_resistance_key = self.rolling_resistance_key + else: + rolling_resistance_key = self.rolling_resistance_key + + traction_coefficient = self.traction_coefficient + + traction_coefficient_key: None | str | Unset + if isinstance(self.traction_coefficient_key, Unset): + traction_coefficient_key = UNSET + elif isinstance(self.traction_coefficient_key, str): + traction_coefficient_key = self.traction_coefficient_key + else: + traction_coefficient_key = self.traction_coefficient_key + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if cost is not UNSET: + field_dict["cost"] = cost + if rolling_radius is not UNSET: + field_dict["rolling_radius"] = rolling_radius + if rolling_resistance_coefficient is not UNSET: + field_dict["rolling_resistance_coefficient"] = rolling_resistance_coefficient + if rolling_resistance_key is not UNSET: + field_dict["rolling_resistance_key"] = rolling_resistance_key + if traction_coefficient is not UNSET: + field_dict["traction_coefficient"] = traction_coefficient + if traction_coefficient_key is not UNSET: + field_dict["traction_coefficient_key"] = traction_coefficient_key + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + cost = d.pop("cost", UNSET) + + rolling_radius = d.pop("rolling_radius", UNSET) + + rolling_resistance_coefficient = d.pop("rolling_resistance_coefficient", UNSET) + + def _parse_rolling_resistance_key( + data: object, + ) -> None | Unset | WheelRollingResistanceConfigs: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + rolling_resistance_key_type_0 = check_wheel_rolling_resistance_configs(data) + + return rolling_resistance_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelRollingResistanceConfigs, data) + + rolling_resistance_key = _parse_rolling_resistance_key( + d.pop("rolling_resistance_key", UNSET) + ) + + traction_coefficient = d.pop("traction_coefficient", UNSET) + + def _parse_traction_coefficient_key( + data: object, + ) -> None | SurfaceConditionTractionConfigs | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + traction_coefficient_key_type_0 = check_surface_condition_traction_configs(data) + + return traction_coefficient_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SurfaceConditionTractionConfigs | Unset, data) + + traction_coefficient_key = _parse_traction_coefficient_key( + d.pop("traction_coefficient_key", UNSET) + ) + + config_type = cast(Literal["wheel"] | Unset, d.pop("config_type", UNSET)) + if config_type != "wheel" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'wheel', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + wheel_input = cls( + item_type=item_type, + name=name, + mass=mass, + cost=cost, + rolling_radius=rolling_radius, + rolling_resistance_coefficient=rolling_resistance_coefficient, + rolling_resistance_key=rolling_resistance_key, + traction_coefficient=traction_coefficient, + traction_coefficient_key=traction_coefficient_key, + config_type=config_type, + part_type=part_type, + ) + + wheel_input.additional_properties = d + return wheel_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/wheel_output.py b/src/ansys/conceptev/core/generated/models/wheel_output.py new file mode 100644 index 00000000..dcd52cd1 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/wheel_output.py @@ -0,0 +1,212 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.surface_condition_traction_configs import ( + SurfaceConditionTractionConfigs, + check_surface_condition_traction_configs, +) +from ..models.wheel_rolling_resistance_configs import ( + WheelRollingResistanceConfigs, + check_wheel_rolling_resistance_configs, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WheelOutput") + + +@_attrs_define +class WheelOutput: + """Wheel Output.""" + + id: str + item_type: Literal["config"] | Unset = "config" + name: str | Unset = "Wheel" + mass: float | Unset = 0.0 + cost: float | Unset = 0.0 + rolling_radius: float | Unset = 0.3 + rolling_resistance_coefficient: float | Unset = 0.02 + rolling_resistance_key: None | Unset | WheelRollingResistanceConfigs = UNSET + traction_coefficient: float | Unset = 0.9 + traction_coefficient_key: None | SurfaceConditionTractionConfigs | Unset = UNSET + config_type: Literal["wheel"] | Unset = "wheel" + part_type: Literal["configuration"] | Unset = "configuration" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + item_type = self.item_type + + name = self.name + + mass = self.mass + + cost = self.cost + + rolling_radius = self.rolling_radius + + rolling_resistance_coefficient = self.rolling_resistance_coefficient + + rolling_resistance_key: None | str | Unset + if isinstance(self.rolling_resistance_key, Unset): + rolling_resistance_key = UNSET + elif isinstance(self.rolling_resistance_key, str): + rolling_resistance_key = self.rolling_resistance_key + else: + rolling_resistance_key = self.rolling_resistance_key + + traction_coefficient = self.traction_coefficient + + traction_coefficient_key: None | str | Unset + if isinstance(self.traction_coefficient_key, Unset): + traction_coefficient_key = UNSET + elif isinstance(self.traction_coefficient_key, str): + traction_coefficient_key = self.traction_coefficient_key + else: + traction_coefficient_key = self.traction_coefficient_key + + config_type = self.config_type + + part_type = self.part_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if item_type is not UNSET: + field_dict["item_type"] = item_type + if name is not UNSET: + field_dict["name"] = name + if mass is not UNSET: + field_dict["mass"] = mass + if cost is not UNSET: + field_dict["cost"] = cost + if rolling_radius is not UNSET: + field_dict["rolling_radius"] = rolling_radius + if rolling_resistance_coefficient is not UNSET: + field_dict["rolling_resistance_coefficient"] = rolling_resistance_coefficient + if rolling_resistance_key is not UNSET: + field_dict["rolling_resistance_key"] = rolling_resistance_key + if traction_coefficient is not UNSET: + field_dict["traction_coefficient"] = traction_coefficient + if traction_coefficient_key is not UNSET: + field_dict["traction_coefficient_key"] = traction_coefficient_key + if config_type is not UNSET: + field_dict["config_type"] = config_type + if part_type is not UNSET: + field_dict["part_type"] = part_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + item_type = cast(Literal["config"] | Unset, d.pop("item_type", UNSET)) + if item_type != "config" and not isinstance(item_type, Unset): + raise ValueError(f"item_type must match const 'config', got '{item_type}'") + + name = d.pop("name", UNSET) + + mass = d.pop("mass", UNSET) + + cost = d.pop("cost", UNSET) + + rolling_radius = d.pop("rolling_radius", UNSET) + + rolling_resistance_coefficient = d.pop("rolling_resistance_coefficient", UNSET) + + def _parse_rolling_resistance_key( + data: object, + ) -> None | Unset | WheelRollingResistanceConfigs: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + rolling_resistance_key_type_0 = check_wheel_rolling_resistance_configs(data) + + return rolling_resistance_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | WheelRollingResistanceConfigs, data) + + rolling_resistance_key = _parse_rolling_resistance_key( + d.pop("rolling_resistance_key", UNSET) + ) + + traction_coefficient = d.pop("traction_coefficient", UNSET) + + def _parse_traction_coefficient_key( + data: object, + ) -> None | SurfaceConditionTractionConfigs | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + traction_coefficient_key_type_0 = check_surface_condition_traction_configs(data) + + return traction_coefficient_key_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SurfaceConditionTractionConfigs | Unset, data) + + traction_coefficient_key = _parse_traction_coefficient_key( + d.pop("traction_coefficient_key", UNSET) + ) + + config_type = cast(Literal["wheel"] | Unset, d.pop("config_type", UNSET)) + if config_type != "wheel" and not isinstance(config_type, Unset): + raise ValueError(f"config_type must match const 'wheel', got '{config_type}'") + + part_type = cast(Literal["configuration"] | Unset, d.pop("part_type", UNSET)) + if part_type != "configuration" and not isinstance(part_type, Unset): + raise ValueError(f"part_type must match const 'configuration', got '{part_type}'") + + wheel_output = cls( + id=id, + item_type=item_type, + name=name, + mass=mass, + cost=cost, + rolling_radius=rolling_radius, + rolling_resistance_coefficient=rolling_resistance_coefficient, + rolling_resistance_key=rolling_resistance_key, + traction_coefficient=traction_coefficient, + traction_coefficient_key=traction_coefficient_key, + config_type=config_type, + part_type=part_type, + ) + + wheel_output.additional_properties = d + return wheel_output + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/ansys/conceptev/core/generated/models/wheel_rolling_resistance_configs.py b/src/ansys/conceptev/core/generated/models/wheel_rolling_resistance_configs.py new file mode 100644 index 00000000..94b3d457 --- /dev/null +++ b/src/ansys/conceptev/core/generated/models/wheel_rolling_resistance_configs.py @@ -0,0 +1,17 @@ +from typing import Literal + +WheelRollingResistanceConfigs = Literal["Car on asphalt", "Car on concrete", "Car on gravel"] + +WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES: set[WheelRollingResistanceConfigs] = { + "Car on asphalt", + "Car on concrete", + "Car on gravel", +} + + +def check_wheel_rolling_resistance_configs(value: str) -> WheelRollingResistanceConfigs: + if value in WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {WHEEL_ROLLING_RESISTANCE_CONFIGS_VALUES!r}" + ) diff --git a/src/ansys/conceptev/core/generated/py.typed b/src/ansys/conceptev/core/generated/py.typed new file mode 100644 index 00000000..1aad3271 --- /dev/null +++ b/src/ansys/conceptev/core/generated/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/src/ansys/conceptev/core/generated/types.py b/src/ansys/conceptev/core/generated/types.py new file mode 100644 index 00000000..b64af095 --- /dev/null +++ b/src/ansys/conceptev/core/generated/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/src/ansys/conceptev/core/ocm.py b/src/ansys/conceptev/core/ocm.py index 898d23ed..603e28d5 100644 --- a/src/ansys/conceptev/core/ocm.py +++ b/src/ansys/conceptev/core/ocm.py @@ -62,7 +62,7 @@ def get_product_id(token: str) -> str: """Get the product ID.""" products = create_ocm_client(token).get("/product/list") if products.status_code != 200: - raise ProductIdsError(f"Failed to get product id.") + raise ProductIdsError("Failed to get product id.") product_id = [ product["productId"] for product in products.json() if product["productName"] == "CONCEPTEV" ][0] @@ -270,7 +270,7 @@ def get_job_file(token, job_id, filename, simulation_id=None, encrypted=False): def get_job_info(token, job_id): """Get the job info from the OnScale Cloud Manager.""" - response = create_ocm_client(token).post(url=f"/job/load", json={"jobId": job_id}) + response = create_ocm_client(token).post(url="/job/load", json={"jobId": job_id}) response = process_response(response) job_info = { "job_id": job_id, diff --git a/tests/e2e/config.toml b/tests/e2e/config.toml index 7f83f67b..0d8882fe 100644 --- a/tests/e2e/config.toml +++ b/tests/e2e/config.toml @@ -1,9 +1,8 @@ -OCM_URL = "https://dev.portal.onscale.com/api" -OCM_SOCKET_URL = "wss://sockets.dev.portal.onscale.com/socket" -CONCEPTEV_URL = "https://test-conceptev.awsansys3np.onscale.com/api" +OCM_URL = "https://test.portal.onscale.com/api" +OCM_SOCKET_URL = "wss://sockets.test.portal.onscale.com/socket" +CONCEPTEV_URL = "https://dev-conceptev.awsansys3np.onscale.com/api" client_id = "743c94e3-c72d-4ace-b9ee-ab5c3cbe6504" -authority = "https://a365dev.b2clogin.com/a365dev.onmicrosoft.com/b2c_1a_ansysid_signup_signin_test" +authority = "https://a365dev.b2clogin.com/a365dev.onmicrosoft.com/b2c_1a_ansysid_signup_signin" scope = "https://a365dev.onmicrosoft.com/AnsysID/Authentication" -conceptev_username = "conceptev_testing@ansys.com" -account_name = "ConceptEv Test Account" +account_name = "USEAST2 DEV" job_timeout = 3600 diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 6e9460dd..0f378ec4 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -63,7 +63,8 @@ import sys _TESTS_DIR = Path(__file__).resolve().parent.parent -E2E_CONFIG = _TESTS_DIR / "integration" / "config.toml" +_E2E_DIR = Path(__file__).resolve().parent +E2E_CONFIG = _E2E_DIR / "config.toml" DATA_DIR = _TESTS_DIR / "integration" @@ -84,7 +85,7 @@ def _read_cev_env_early() -> str: return sys.argv[i + 1].lower() if arg.startswith("--cev-env="): return arg.split("=", 1)[1].lower() - return os.environ.get("CEV_E2E_ENV", "prod").lower() + return os.environ.get("CEV_E2E_ENV", "test").lower() CEV_ENV = _read_cev_env_early() @@ -127,24 +128,24 @@ def pytest_configure(config) -> None: def pytest_addoption(parser: pytest.Parser) -> None: parser.addoption( "--cev-env", - default="prod", + default="test", choices=["prod", "test"], help=( "ConceptEV environment for both the pytest-side data setup and optiSLang. " - "'prod' uses pyconceptev's bundled production config (default). " - "'test' uses tests/integration/config.toml. " + "'test' uses tests/integration/config.toml (default — v2 API). " + "'prod' uses pyconceptev's bundled production config. " "NOTE: this is read from sys.argv at import time — the value here is " "informational and used for validation only." ), ) parser.addoption( "--account-name", - default="Burst Test Account", + default="USEAST2 DEV", metavar="NAME", help=( "ConceptEV account name used for project creation and the optiSLang node. " "Overrides the account_name from the active settings. " - "(default: 'Burst Test Account')" + "(default: 'USEAST 2 DEV')" ), ) parser.addoption( @@ -245,11 +246,14 @@ def session_hpc_id(session_token, session_account_id): @pytest.fixture(scope="session") def e2e_concept(session_token, session_account_id, session_hpc_id): - """Create a fully-populated e2e concept and delete it on session teardown. + """Create a fully-populated e2e concept via the v2 API and delete it on teardown. - The optiSLang ConceptEV plugin's ``sanitize_result_data`` requires - ``data['requirements']`` and a valid architecture. This fixture creates a - known-good concept with: + The integration's ``get_concept`` call uses ``GET /v2/concept/{id}``, so the + concept must exist in the v2 registry. All parts are created through the v2 + ``create_concept_part`` endpoint to guarantee the concept is fully populated + from the v2 perspective. + + The fixture creates a known-good concept with: - MotorLabID rear motor (from the bundled ``e9.lab`` file) - BatteryFixedVoltages, TransmissionLossCoefficients @@ -257,75 +261,168 @@ def e2e_concept(session_token, session_account_id, session_hpc_id): - Aero / mass / wheel configurations - Two static-acceleration requirements (so summary outputs land at _02__summary__) - Yields the ``design_instance_id``. + Yields the v2 concept ``id`` (the path parameter for ``GET /v2/concept/{id}``). """ - with app.get_http_client(session_token) as client: + from ansys.conceptev.core import ocm as _ocm + from ansys.conceptev.core.generated.api.concept_v2 import ( + create_concept_part as _create_concept_part, + ) + from ansys.conceptev.core.generated.api.concept_v2 import create_concept as _create_concept_v2 + from ansys.conceptev.core.generated.api.concept_v2 import create_file_item as _create_file_item + from ansys.conceptev.core.generated.models.aero_input import AeroInput + from ansys.conceptev.core.generated.models.architecture_input import ArchitectureInput + from ansys.conceptev.core.generated.models.battery_fixed_voltages_input import ( + BatteryFixedVoltagesInput, + ) + from ansys.conceptev.core.generated.models.body_create_file_item import BodyCreateFileItem + from ansys.conceptev.core.generated.models.concept_input import ConceptInput + from ansys.conceptev.core.generated.models.mass_input import MassInput + from ansys.conceptev.core.generated.models.motor_lab_input import MotorLabInput + from ansys.conceptev.core.generated.models.static_requirement_input import ( + StaticRequirementInput, + ) + from ansys.conceptev.core.generated.models.transmission_loss_coefficients_input import ( + TransmissionLossCoefficientsInput, + ) + from ansys.conceptev.core.generated.models.wheel_input import WheelInput + from ansys.conceptev.core.generated.types import UNSET + + with app.get_http_client(session_token) as v1_client: project = app.create_new_project( - client, + v1_client, session_account_id, session_hpc_id, "E2E Tests – optiSLang connection", ) - concept = app.create_new_concept( - client, - project["projectId"], - title="E2E optiSLang test concept", + project_id = project["projectId"] + + product_id = app.get_product_id(session_token) + design_instance_id, design_id = _ocm.create_design_instance( + project_id, + "E2E optiSLang test concept", + session_token, + product_id, + return_design_id=True, + ) + + with app.get_conceptev_client(token=session_token) as opc_client: + _v2_concept_resp = _create_concept_v2.sync_detailed( + client=opc_client, + body=ConceptInput( + name="E2E optiSLang test concept", + project_id=project_id, + design_id=design_id, + design_instance_id=design_instance_id, + ), + ) + print( + f"[e2e-setup] POST /v2/concept status={_v2_concept_resp.status_code} " + f"body={_v2_concept_resp.content[:500]!r}" + ) + v2_concept = _v2_concept_resp.parsed + if v2_concept is None or not hasattr(v2_concept, "id"): + pytest.fail( + f"Failed to create v2 concept via POST /v2/concept " + f"(status={_v2_concept_resp.status_code}): {_v2_concept_resp.content!r}" + ) + concept_id = v2_concept.id + + with open(DATA_DIR / "e9.lab", "rb") as fh: + lab_content = fh.read().decode("latin-1") + file_resp = _create_file_item.sync( + id=concept_id, + client=opc_client, + body=BodyCreateFileItem(file=lab_content), + name="e9.lab", + component_file_type="motor_lab_file", + ) + if file_resp is None: + pytest.fail("Failed to upload motor lab file") + lab_data_id = file_resp.id + calc = file_resp.calculated_values + max_speed = 800.0 + if calc is not None and calc is not UNSET: + calc_dict = calc.to_dict() if hasattr(calc, "to_dict") else {} + max_speed = calc_dict.get("max_speed", max_speed) + + motor_resp = _create_concept_part.sync( + id=concept_id, + part_type="component", + client=opc_client, + body=MotorLabInput( + name="E2E Test Rear Motor", + max_speed=max_speed, + lab_data_id=lab_data_id, + ), + ) + if motor_resp is None: + pytest.fail("Failed to create motor component") + motor_id = motor_resp.id + + battery_resp = _create_concept_part.sync( + id=concept_id, + part_type="component", + client=opc_client, + body=BatteryFixedVoltagesInput(), + ) + if battery_resp is None: + pytest.fail("Failed to create battery component") + battery_id = battery_resp.id + + transmission_resp = _create_concept_part.sync( + id=concept_id, + part_type="component", + client=opc_client, + body=TransmissionLossCoefficientsInput(), + ) + if transmission_resp is None: + pytest.fail("Failed to create transmission component") + transmission_id = transmission_resp.id + + _create_concept_part.sync( + id=concept_id, + part_type="architecture", + client=opc_client, + body=ArchitectureInput( + battery_id=battery_id, + number_of_rear_motors=1, + rear_motor_id=motor_id, + rear_transmission_id=transmission_id, + ), ) - design_instance_id = concept["design_instance_id"] - - with app.get_http_client(session_token, design_instance_id) as client: - motor_file_result = app.post_component_file(client, DATA_DIR / "e9.lab", "motor_lab_file") - motor = app.post( - client, - "/components", - data={ - "component_type": "MotorLabID", - "name": "E2E Test Rear Motor", - "data_id": motor_file_result[0], - "max_speed": motor_file_result[1], - "inverter_losses_included": False, - }, + aero_resp = _create_concept_part.sync( + id=concept_id, part_type="configuration", client=opc_client, body=AeroInput() ) - battery = app.post(client, "/components", data={"component_type": "BatteryFixedVoltages"}) - transmission = app.post( - client, "/components", data={"component_type": "TransmissionLossCoefficients"} + mass_resp = _create_concept_part.sync( + id=concept_id, part_type="configuration", client=opc_client, body=MassInput() ) - app.post( - client, - "/architectures", - data={ - "number_of_front_motors": 0, - "number_of_front_wheels": 2, - "number_of_rear_motors": 1, - "number_of_rear_wheels": 2, - "rear_transmission_id": transmission["id"], - "rear_motor_id": motor["id"], - "battery_id": battery["id"], - }, + wheel_resp = _create_concept_part.sync( + id=concept_id, part_type="configuration", client=opc_client, body=WheelInput() ) - aero = app.post(client, "/configurations", data={"config_type": "aero"}) - mass = app.post(client, "/configurations", data={"config_type": "mass"}) - wheel = app.post(client, "/configurations", data={"config_type": "wheel"}) + aero_id = aero_resp.id + mass_id = mass_resp.id + wheel_id = wheel_resp.id + for speed, accel in ((10, 0.5), (20, 0.3)): - app.post( - client, - "/requirements", - data={ - "requirement_type": "static_acceleration", - "speed": speed, - "mass_id": mass["id"], - "aero_id": aero["id"], - "wheel_id": wheel["id"], - "state_of_charge": 0.75, - "acceleration": accel, - }, + _create_concept_part.sync( + id=concept_id, + part_type="requirement", + client=opc_client, + body=StaticRequirementInput( + aero_id=aero_id, + mass_id=mass_id, + wheel_id=wheel_id, + speed=float(speed), + acceleration=accel, + state_of_charge=0.75, + ), ) - print(f"[e2e-setup] created concept: design_instance_id={design_instance_id}") - yield design_instance_id - app.delete_project(project["projectId"], session_token) - print(f"[e2e-setup] deleted project {project['projectId']}") + print(f"[e2e-setup] created concept: design_instance_id={concept_id}") + yield concept_id + app.delete_project(project_id, session_token) + print(f"[e2e-setup] deleted project {project_id}") # --------------------------------------------------------------------------- @@ -456,7 +553,7 @@ def install_pyconceptev(request): f"pip install '{src}' failed (exit {result.returncode}).\n" f"stderr: {result.stderr}" ) - print(f"[install-pyconceptev] installation succeeded") + print("[install-pyconceptev] installation succeeded") yield src @@ -465,14 +562,47 @@ def install_pyconceptev(request): # --------------------------------------------------------------------------- +def _get_osl_user_site_packages() -> Path | None: + """Return optiSLang's user site-packages directory, or None if not found. + + optiSLang's bundled Python adds the user site-packages directory to + sys.path (e.g. AppData/Roaming/Python/Python310/site-packages on Windows). + Packages installed there are found by the standard Python import machinery + *before* the PYE import hook resolves .pye files from the integrations + directory, which lets us shadow the encrypted sub-modules with plain .py + files during test injection. + """ + result = subprocess.run( + [str(_OSL_PYTHON), "-c", "import site; print(site.getusersitepackages())"], + capture_output=True, + text=True, + ) + if result.returncode != 0 or not result.stdout.strip(): + return None + return Path(result.stdout.strip()) + + @pytest.fixture(scope="session") def inject_integration(request, install_pyconceptev): # noqa: ARG001 """Replace the installed OptiSLang conceptev integration with files from a source folder. - Activated by the ``--integration-dir PATH`` CLI option. Each ``.py`` source - file under PATH is copied over its ``.pye`` counterpart in the optiSLang - scripting/integrations directory. Original bytes are held in memory and - written back on session teardown, even when the test fails. + Activated by the ``--integration-dir PATH`` CLI option. + + Two-pronged injection strategy + -------------------------------- + 1. ``conceptev_ci.pye`` (the top-level integration script) is replaced with + the plain ``.py`` source file. optiSLang executes this file as a script, + not through its PYE import hook, so plain Python works here. + + 2. The ``conceptev/`` sub-package is installed as plain ``.py`` files into + optiSLang's *user* site-packages directory (e.g. + ``AppData/Roaming/Python/Python310/site-packages/conceptev/``). This + directory sits earlier in ``sys.path`` than the integrations directory, so + Python's standard import machinery finds the plain ``.py`` modules before + optiSLang's PYE hook can intercept and reject them due to checksum + mismatch. + + All changes are reverted on session teardown. When ``--integration-dir`` is not given the fixture yields ``None`` and the already-installed integration is used unchanged. @@ -486,54 +616,63 @@ def inject_integration(request, install_pyconceptev): # noqa: ARG001 if not src_dir.is_dir(): pytest.fail(f"--integration-dir does not exist or is not a directory: {src_dir}") - # Collect: top-level conceptev_ci.py + every .py under conceptev/ subfolder. - src_files = [src_dir / "conceptev_ci.py"] + [ - p for p in (src_dir / "conceptev").rglob("*.py") if not p.name.startswith("_") - ] - # Also include __init__.py files. - src_files += [p for p in (src_dir / "conceptev").rglob("__init__.py")] - # Deduplicate while preserving order. - seen: set[Path] = set() - unique_src: list[Path] = [] - for p in src_files: - if p not in seen: - seen.add(p) - unique_src.append(p) - - mapping: dict[Path, Path] = {} - for src in unique_src: - rel = src.relative_to(src_dir) - dst = _OSL_INTEGRATIONS_DIR / rel.with_suffix(".pye") - mapping[src] = dst - - # Backup existing .pye content (keyed by destination path). - backups: dict[Path, bytes] = {} - for dst in mapping.values(): - if dst.exists(): - backups[dst] = dst.read_bytes() - - # Copy source files over installed .pye files. - copied: list[Path] = [] + # ------------------------------------------------------------------ + # 1. Replace conceptev_ci.pye with the plain .py source (script mode) + # ------------------------------------------------------------------ + ci_src = src_dir / "conceptev_ci.py" + ci_dst = _OSL_INTEGRATIONS_DIR / "conceptev_ci.pye" + ci_backup: bytes | None = ci_dst.read_bytes() if ci_dst.exists() else None try: - for src, dst in mapping.items(): - dst.parent.mkdir(parents=True, exist_ok=True) - shutil.copy2(src, dst) - copied.append(dst) - print(f"[inject-integration] {src.name} -> {dst}") + shutil.copy2(ci_src, ci_dst) + print(f"[inject-integration] {ci_src.name} -> {ci_dst}") except PermissionError as exc: pytest.fail( f"Cannot write to optiSLang integration directory — run pytest as admin " f"or adjust permissions on {_OSL_INTEGRATIONS_DIR}.\n Error: {exc}" ) - print(f"[inject-integration] injected {len(copied)} file(s) from {src_dir}") + # ------------------------------------------------------------------ + # 2. Install conceptev/ sub-package into optiSLang user site-packages + # so plain .py files are found before the PYE import hook. + # ------------------------------------------------------------------ + user_site = _get_osl_user_site_packages() + if user_site is None: + pytest.fail( + "Cannot determine optiSLang's user site-packages directory. " + f"Check that {_OSL_PYTHON} is accessible." + ) + + conceptev_src = src_dir / "conceptev" + conceptev_dst = user_site / "conceptev" + + # Back up any existing conceptev package at that location. + conceptev_dst_backup: Path | None = None + if conceptev_dst.exists(): + conceptev_dst_backup = conceptev_dst.parent / f"_conceptev_backup_{os.getpid()}" + shutil.move(str(conceptev_dst), str(conceptev_dst_backup)) + print(f"[inject-integration] backed up existing {conceptev_dst} -> {conceptev_dst_backup}") + + shutil.copytree(conceptev_src, conceptev_dst) + print(f"[inject-integration] installed conceptev/ package -> {conceptev_dst}") + print(f"[inject-integration] injected integration from {src_dir}") + yield src_dir - # Restore originals. - for dst, data in backups.items(): - dst.write_bytes(data) - # Remove any destination files that had no pre-existing backup (new files added). - for dst in mapping.values(): - if dst not in backups and dst.exists(): - dst.unlink() - print(f"[inject-integration] restored {len(backups)} original file(s)") + # ------------------------------------------------------------------ + # Teardown: restore everything + # ------------------------------------------------------------------ + # Restore conceptev_ci.pye + if ci_backup is not None: + ci_dst.write_bytes(ci_backup) + elif ci_dst.exists(): + ci_dst.unlink() + print(f"[inject-integration] restored {ci_dst.name}") + + # Remove injected conceptev/ from user site-packages + if conceptev_dst.exists(): + shutil.rmtree(conceptev_dst) + # Restore previous conceptev/ if there was one + if conceptev_dst_backup is not None and conceptev_dst_backup.exists(): + shutil.move(str(conceptev_dst_backup), str(conceptev_dst)) + print(f"[inject-integration] restored {conceptev_dst} from backup") + print("[inject-integration] teardown complete") diff --git a/tests/integration/test_optislang_integration.py b/tests/integration/test_optislang_integration.py index 3dc4b6a0..b82b4c32 100644 --- a/tests/integration/test_optislang_integration.py +++ b/tests/integration/test_optislang_integration.py @@ -191,7 +191,7 @@ def test_msal_app(msal_app): def test_auth_app(token): """Test that the optislang integration works.""" assert isinstance(token, str) - claims = jwt.decode(token, options={"verify_signature": False}) + jwt.decode(token, options={"verify_signature": False}) # Step 1: Fetch JWKS jwks = httpx.get(auth.settings.authority + "/discovery/v2.0/keys").json() diff --git a/tests/unit/test_app.py b/tests/unit/test_app.py index 5e766aae..e505e78c 100644 --- a/tests/unit/test_app.py +++ b/tests/unit/test_app.py @@ -567,7 +567,7 @@ def test_returns_final_status_when_present(httpx_mock, final_status, last_status ) if final_status is None and last_status is None: - with pytest.raises(ResponseError) as exc: + with pytest.raises(ResponseError): result = app.get_status(job_info, token) return True else: diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index d8647146..93afb2cf 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -115,11 +115,9 @@ def test_auth_initialization_creates_msal_app(mocker): def test_auth_flow_adds_authorization_header(mocker, httpx_mock: HTTPXMock): - mock_get_ansyId_token = mocker.patch( - "ansys.conceptev.core.auth.get_ansyId_token", return_value="auth_class_token" - ) + mocker.patch("ansys.conceptev.core.auth.get_ansyId_token", return_value="auth_class_token") auth_instance = auth.AnsysIDAuth() - httpx_mock.add_response(url=f"http://example.com") + httpx_mock.add_response(url="http://example.com") client = httpx.Client(auth=auth_instance) response = client.get("http://example.com") assert response.request.headers["Authorization"] == "auth_class_token" diff --git a/tox.ini b/tox.ini index 25a8b21e..d2a87deb 100644 --- a/tox.ini +++ b/tox.ini @@ -40,3 +40,16 @@ allowlist_externals = commands = poetry install --with doc poetry run sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/_build/html" --color -vW -bhtml + +[testenv:codegen] +description = Regenerate the API client from the committed spec and fail if the result differs +skip_install = true +allowlist_externals = + poetry + git +commands = + poetry install --with build + # Regenerate from the committed openapi_v2.json (--no-export skips the network call) + poetry run python scripts/generate_client.py --no-export + # Fail if the regenerated code differs from what is committed + git diff --exit-code src/ansys/conceptev/core/generated/